class PSerialRegistration

Registration class for persistent object serialisation/unserialisation.

Public Methods

[more]typedef PObject* (*CreatorFunction) (PUnSerialiser* serial)
This type is a pointer to a function to create objects during the un-serialisation operation
[more] PSerialRegistration ( const char* clsNam, CreatorFunction func )
Create a serialiser class registration.
[more]static CreatorFunction GetCreator ( const char* clsNam )
Get the creator function for the class name specified.

Protected Fields

[more]const char* className
This serialiser registrations class
[more]CreatorFunction creator
This serialiser registrations creator function - the function that will make a new object of the classes type and construct it with an instance of the PSerialiser class
[more]PSerialRegistration* clash
Pointer to next registration when a hash clash occurs
[more]static PSerialRegistration* creatorHashTable [HashTableSize]
A static dictionary of class names to creator functions

Protected Methods

[more]static PINDEX HashFunction ( const char* className )
Calculate the bucket for the hash table lookup.


Documentation

Registration class for persistent object serialisation/unserialisation. This class is for registration of object classes that will be serialised and un-serialised.

As objects are un-serialised, the objects need to be constructed. For the PUnSerialiser instance to know what constructor to call, a registration of functions that call the appropriate constructor.

The PDECLARE_SERIAL macro creates a single instance of this class to register the class with the serialiser.

Even though this class implements a hash table it does not use the standard PHashTable or PDictionary classes due to recursive definition problems. Those classes need to register themselves with this class before they can be used!

otypedef PObject* (*CreatorFunction)(PUnSerialiser* serial)
This type is a pointer to a function to create objects during the un-serialisation operation

o PSerialRegistration( const char* clsNam, CreatorFunction func )
Create a serialiser class registration. This is unversally called by static member variables in the PDECLARE_SERIAL and PIMPLEMENT_SERIAL macros.

ostatic CreatorFunction GetCreator( const char* clsNam )
Get the creator function for the class name specified.

Returns:
function to construct objects.

ostatic PINDEX HashFunction( const char* className )
Calculate the bucket for the hash table lookup.
Returns:
Has index for class.

oconst char* className
This serialiser registrations class

oCreatorFunction creator
This serialiser registrations creator function - the function that will make a new object of the classes type and construct it with an instance of the PSerialiser class

oPSerialRegistration* clash
Pointer to next registration when a hash clash occurs

ostatic PSerialRegistration* creatorHashTable[HashTableSize]
A static dictionary of class names to creator functions


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.