Public Member Functions | Protected Member Functions

vtkKWESerializer Class Reference

Abstract superclass of input and output archivers. More...

#include <vtkKWESerializer.h>

Inheritance diagram for vtkKWESerializer:
Inheritance graph
[legend]
Collaboration diagram for vtkKWESerializer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 vtkTypeRevisionMacro (vtkKWESerializer, vtkObject)
void PrintSelf (ostream &os, vtkIndent indent)
virtual bool IsWriting ()=0
virtual void Serialize (const char *name, int &val)=0
virtual void Serialize (const char *name, int *&val, unsigned int &length)=0
virtual void Serialize (const char *name, unsigned long &val)=0
virtual void Serialize (const char *name, unsigned long *&val, unsigned int &length)=0
virtual void Serialize (const char *name, double &val)=0
virtual void Serialize (const char *name, double *&val, unsigned int &length)=0
virtual void Serialize (const char *name, char *&str)=0
virtual void Serialize (const char *name, vtkstd::string &str)=0
virtual void Serialize (const char *name, vtkObject *&obj, bool weakPtr=false)=0
virtual void Serialize (const char *name, vtkInformation *info)=0

virtual void Serialize (const char *name, vtkstd::vector< vtkSmartPointer< vtkObject > > &objs, bool weakPtr=false)=0

virtual void Serialize (const char *name, vtkstd::map< int, vtkstd::vector< vtkSmartPointer< vtkObject > > > &objs)=0

virtual void SetArchiveVersion (unsigned int)
virtual unsigned int GetArchiveVersion ()

Static Public Member Functions

template<typename Container >
static vtkstd::vector
< vtkSmartPointer< vtkObject > > 
ToBase (Container &from)

template<typename T , typename Container >
static void FromBase (vtkstd::vector< vtkSmartPointer< vtkObject > > &from, Container &to)

template<typename Container >
static vtkstd::map< int,
vtkstd::vector
< vtkSmartPointer< vtkObject > > > 
ToBase (vtkstd::map< int, Container > &from)

template<typename T , typename Container >
static void FromBase (vtkstd::map< int, vtkstd::vector< vtkSmartPointer< vtkObject > > > &from, vtkstd::map< int, Container > &to)

Protected Member Functions

 vtkKWESerializer ()
 ~vtkKWESerializer ()

Detailed Description

Abstract superclass of input and output archivers.

vtkKWESerializer and its sub-classes are used to serialize and de-serialize a collection of objects to/from an io stream. The serializers can work with vtkKWESerializableObject and its subclasses, or vtkObjects in general that have a subclass of vtkKWESerializationHelper registered with vtkKWESerializationHelperMap. It can walk a object graph and serialize/deserialize all objects contained in it. Circular references are supported. In order to (most easily) add serialization support to your class, subclass from vtkKWESerializableObject and re-implement its Serialize() method using methods available in the serializer. Otherwise create a subclass vtkKWESerializationHelper and register it with the serialization manager See vtkKWESerializableObject for details.

See also:
vtkKWESerializableObject vtkKWESerializationHelper vtkKWESerializationHelperMap

Definition at line 52 of file vtkKWESerializer.h.


Constructor & Destructor Documentation

vtkKWESerializer::vtkKWESerializer (  )  [protected]
vtkKWESerializer::~vtkKWESerializer (  )  [inline, protected]

Definition at line 220 of file vtkKWESerializer.h.


Member Function Documentation

vtkKWESerializer::vtkTypeRevisionMacro ( vtkKWESerializer  ,
vtkObject   
)
void vtkKWESerializer::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkObject.

Reimplemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual bool vtkKWESerializer::IsWriting (  )  [pure virtual]

This method returns true if the serializer is an output serializer (writer)

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
int &  val 
) [pure virtual]

Serializes a single integer.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
int *&  val,
unsigned int &  length 
) [pure virtual]

Serializes an array.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
unsigned long &  val 
) [pure virtual]

Serializes a single unsigned long.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
unsigned long *&  val,
unsigned int &  length 
) [pure virtual]

Serializes an array.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
double &  val 
) [pure virtual]

Serializes a single vtkIdType.

Serializes an array.

Serializes a single double.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
double *&  val,
unsigned int &  length 
) [pure virtual]

Serializes an array.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
char *&  str 
) [pure virtual]

Serializes a string.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
vtkstd::string &  str 
) [pure virtual]

Serializes a string.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
vtkObject *&  obj,
bool  weakPtr = false 
) [pure virtual]

Serializes a vtkObject.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
vtkInformation info 
) [pure virtual]

Serializes a vtkInformationObject. Note that only keys registered with the vtkKWEInformationKeyMap are restored.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
vtkstd::vector< vtkSmartPointer< vtkObject > > &  objs,
bool  weakPtr = false 
) [pure virtual]

Serializes a vector of vtkObjects.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::Serialize ( const char *  name,
vtkstd::map< int, vtkstd::vector< vtkSmartPointer< vtkObject > > > &  objs 
) [pure virtual]

Serializes a map from int to vector of vtkObjects.

Implemented in vtkKWEXMLArchiveReader, and vtkKWEXMLArchiveWriter.

virtual void vtkKWESerializer::SetArchiveVersion ( unsigned  int  )  [virtual]

Set/Get the archive version. Make sure to set the version before writing to an archive. When reading an archive, the version is read from the input stream.

virtual unsigned int vtkKWESerializer::GetArchiveVersion (  )  [virtual]

Set/Get the archive version. Make sure to set the version before writing to an archive. When reading an archive, the version is read from the input stream.

template<typename Container >
static vtkstd::vector<vtkSmartPointer<vtkObject> > vtkKWESerializer::ToBase ( Container &  from  )  [inline, static]

Helper function to make is easier to write containers of sub-classes of vtkObject. For example:

      vtkstd::Container<vtkSmartPointer<vtkSubclass> > sub;
      vtkstd::vector<vtkSmartPointer<vtkObject> > vec =
      vtkKWESerializer::ToBase<Container>(sub); ser->Serialize("Vector",
      vec); 

The container must support forward iteration, begin(), end(), and push_back.

Definition at line 137 of file vtkKWESerializer.h.

template<typename T , typename Container >
static void vtkKWESerializer::FromBase ( vtkstd::vector< vtkSmartPointer< vtkObject > > &  from,
Container &  to 
) [inline, static]

Helper function to make it easier to read into containers of sub-classes of vtkObject. For example:

      vtkstd::Container<vtkSmartPointer<vtkSubclass> > sub;
      vtkstd::vector<vtkSmartPointer<vtkObject> >  vec;
      ser->Serialize("Vector", vec);
      vtkKWESerializer::FromBase<vtkConceptualModelItem,Container>(vec,
      sub); 

The container must support forward iteration, begin(), end(), and push_back.

Definition at line 159 of file vtkKWESerializer.h.

template<typename Container >
static vtkstd::map<int, vtkstd::vector<vtkSmartPointer<vtkObject> > > vtkKWESerializer::ToBase ( vtkstd::map< int, Container > &  from  )  [inline, static]

Helper function to make it easier to write maps of containers of sub-classes of vtkObject. For example:

 vtkstd::map<int,
      vtkstd::vector<vtkSmartPointer<vtkObject> > > map =
      vtkKWESerializer::ToBase<Container>(this->Internal->Associations);
      ser->Serialize("Associations", map); 

The container must support forward iteration, begin(), end(), and push_back.

Definition at line 181 of file vtkKWESerializer.h.

template<typename T , typename Container >
static void vtkKWESerializer::FromBase ( vtkstd::map< int, vtkstd::vector< vtkSmartPointer< vtkObject > > > &  from,
vtkstd::map< int, Container > &  to 
) [inline, static]

Helper function to make it easier to read maps of containers of sub-classes of vtkObject. For example:

 vtkstd::map<int,
      vtkstd::vector<vtkSmartPointer<vtkObject> > > map;
      ser->Serialize("Associations", map);
      vtkKWESerializer::FromBase<vtkConceptualModelItem,Container>(map,
      this->Internal->Associations); 

The container must support forward iteration, begin(), end(), and push_back.

Definition at line 203 of file vtkKWESerializer.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines