classPiiSerializer
#include <PiiSerializer.h>
Serializer is an object that takes care of serializing objects.
Inherited by PiiSerializerTemplate< Archive, T >
Description
Each archive type has a static registry of serializers stored in a hash map. The reason serialization goes through PiiSerializer is that this allows one to conveniently create a name-based dictionary of serializers with virtual serialization functions.
Public types
|
typedef QHash< PiiConstCharWrapper,
PiiSerializer<
Archive > * >
|
The type of the serializer map. |
Constructors and destructor
|
(
Create a new serializer and insert it to the static serializer map. |
|
|
virtual
|
( )
Removes |
Public member functions
|
virtual void
|
(
Subclasses override this function to serialize any custom type. |
Static public member functions
|
static QList< const char *
>
|
( )
Returns a list of type names for all registered serializers. |
|
template<class T>
static bool
|
(
Seializes an object of type |
|
static const PiiSerializer *
|
(
Returns the serializer associated with className, or 0 if no serializer is found. |
Protected member functions
|
(
Create a new serializer and insert it to the static serializer map. |
Function details
-
PiiSerializer
(- const char * name
[protected]Create a new serializer and insert it to the static serializer map.
The class is identified by the given name, which must be application-wide unique.
-
virtual ~PiiSerializer
()[virtual]Removes
thisfrom the archive's serializer map. -
Returns a list of type names for all registered serializers.
-
template<class T>
static bool serialize
(- const char * className
- Archive & archive
- T & value
- const unsigned int version
[static]Seializes an object of type
T.If
Tis a dynamic type, this function fetches a serializer for the type denoted by className. If no serializer is found, returnsfalse. Otherwise, it calls the virtual serialize() function of the found serializer and returnstrue. If the type is not dynamic, PiiSerialization::serialize() will be called directly. -
Returns the serializer associated with className, or 0 if no serializer is found.
-
virtual void serialize
(- Archive & archive
- void * value
- const unsigned int version
[pure virtual]Subclasses override this function to serialize any custom type.
Parameters
- archive
-
the archive to store the data into
- value
-
a pointer to the object to be stored. Subclasses should use
reinterpret_castto convert the pointer to the correct type. - version
-
the version of the class
Add a note
Not a single note added yet. Be the first, add yours.