vtkSMDeserializer.h 1.94 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*=========================================================================

  Program:   ParaView
  Module:    vtkSMDeserializer.h

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
15
// .NAME vtkSMDeserializer - deserializes proxies from their states.
16
// .SECTION Description
17 18 19
// vtkSMDeserializer is used to deserialize proxies from their XML/Protobuf/?
// states. This is the base class of deserialization classes that load
// XMLs/Protobuf/? to restore servermanager state (or part thereof).
20 21 22 23

#ifndef __vtkSMDeserializer_h
#define __vtkSMDeserializer_h

24
#include "vtkSMSessionObject.h"
25 26 27 28

class vtkPVXMLElement;
class vtkSMProxy;
class vtkSMProxyLocator;
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
29
class vtkSMSession;
30

31
class VTK_EXPORT vtkSMDeserializer : public vtkSMSessionObject
32 33
{
public:
34
  vtkTypeMacro(vtkSMDeserializer, vtkSMSessionObject);
35 36 37 38 39 40 41 42 43 44 45
  void PrintSelf(ostream& os, vtkIndent indent);

//BTX
protected:
  vtkSMDeserializer();
  ~vtkSMDeserializer();

  // Friend to access NewProxy().
  friend class vtkSMProxyLocator;

  // Description:
46 47
  // Create a new proxy with the id if possible.
  virtual vtkSMProxy* NewProxy(vtkTypeUInt32 id, vtkSMProxyLocator* locator) = 0;
48 49 50 51

  // Description:
  // Create a new proxy of the given group and name. Default implementation
  // simply asks the proxy manager to create a new proxy of the requested type.
52 53
  virtual vtkSMProxy* CreateProxy(const char* xmlgroup, const char* xmlname,
                                  const char* subProxyName = NULL);
54 55 56 57 58 59 60 61

private:
  vtkSMDeserializer(const vtkSMDeserializer&); // Not implemented
  void operator=(const vtkSMDeserializer&); // Not implemented
//ETX
};

#endif