#include <coherence/io/pof/PofAnnotationSerializer.hpp>
Inherits Object, and PofSerializer.
This serializer must be instantiated with the intended class which is eventually scanned for the presence of the following annotations.
This serializer supports classes iff they are annotated with the type level annotation; Portable. This annotation is a marker indicating the ability to (de)serialize using this serializer.
All methods annotated with PortableProperty are explicitly deemed POF serializable with the option of specifying overrides to provide explicit behaviour such as:
The PortableProperty::getIndex() (POF index) can be omitted iff the auto-indexing feature is enabled. This is enabled by instantiating this class with the fAutoIndex
constructor argument. This feature determines the index based on any explicit indexes specified and the name of the portable properties. Currently objects with multiple versions is not supported. The following illustrates the auto index algorithm:
Name | Explicit Index | Determined Index |
c | 1 | 1 |
a | 0 | |
b | 2 |
NOTE: This implementation does support objects that implement Evolvable.
COH_REGISTER_POF_ANNOTATED_CLASS
COH_REGISTER_POF_ANNOTATED_CLASS_AI
Portable
Public Types | |
typedef spec::Handle | Handle |
PofAnnotationSerializer Handle definition. | |
typedef spec::View | View |
PofAnnotationSerializer View definition. | |
typedef spec::Holder | Holder |
PofAnnotationSerializer Holder definition. | |
Public Member Functions | |
virtual void | serialize (PofWriter::Handle hOut, Object::View v) const |
virtual Object::Holder | deserialize (PofReader::Handle hIn) const |
Protected Member Functions | |
PofAnnotationSerializer (int32_t nTypeId, Class::View vClz, bool fAutoIndex=false) | |
Constructs a PofAnnotationSerializer. | |
virtual void | initialize (int32_t nTypeId, Class::View vClz, bool fAutoIndex) |
Initialize this class based on the provided information. |
PofAnnotationSerializer | ( | int32_t | nTypeId, | |
Class::View | vClz, | |||
bool | fAutoIndex = false | |||
) | [protected] |
Constructs a PofAnnotationSerializer.
nTypeId | the POF type id | |
vClz | type this serializer is aware of | |
fAutoIndex | turns on the auto index feature, default = false |
virtual void initialize | ( | int32_t | nTypeId, | |
Class::View | vClz, | |||
bool | fAutoIndex | |||
) | [protected, virtual] |
Initialize this class based on the provided information.
nTypeId | the POF type id | |
vClz | type this serializer is aware of | |
fAutoIndex | turns on the auto index feature |