#include <coherence/io/pof/EvolvableObject.hpp>
Inherits Object.
Public Types | |
typedef spec::Handle | Handle |
EvolvableObject Handle definition. | |
typedef spec::View | View |
EvolvableObject View definition. | |
typedef spec::Holder | Holder |
EvolvableObject Holder definition. | |
Public Member Functions | |
virtual Evolvable::View | getEvolvable (int32_t nTypeId) const =0 |
Return Evolvable holder object for the specified type id. | |
virtual Evolvable::Handle | getEvolvable (int32_t nTypeId)=0 |
Return Evolvable holder object for the specified type id. | |
virtual EvolvableHolder::View | getEvolvableHolder () const =0 |
Return EvolvableHolder that can be used to store information about evolvable objects that are not known during deserialization. |
virtual Evolvable::View getEvolvable | ( | int32_t | nTypeId | ) | const [pure virtual] |
Return Evolvable holder object for the specified type id.
This method should only return Evolvable instance if the specified type id matches its own type id. Otherwise, it should delegate to the parent:
// assuming type ID of this class is 1234 FinalView<Evolvable> f_vEvolvable; ... // in constructor : f_vEvolvable(self(), SimpleEvolvable::create(IMPL_VERSION)) ... Evolvable::View getEvolvable(int32_t nTypeId) { if (1234 == nTypeId) { return f_vEvolvable; }
return super::getEvolvable(nTypeId); }
nTypeId | type id to get Evolvable instance for |
virtual Evolvable::Handle getEvolvable | ( | int32_t | nTypeId | ) | [pure virtual] |
Return Evolvable holder object for the specified type id.
This method should only return Evolvable instance if the specified type id matches its own type id. Otherwise, it should delegate to the parent:
// assuming type ID of this class is 1234 FinalView<Evolvable> f_vEvolvable; ... // in constructor : f_vEvolvable(self(), SimpleEvolvable::create(IMPL_VERSION)) ... Evolvable::Handle getEvolvable(int32_t nTypeId) { if (1234 == nTypeId) { return f_vEvolvable; }
return super::getEvolvable(nTypeId); }
nTypeId | type id to get Evolvable instance for |
virtual EvolvableHolder::View getEvolvableHolder | ( | ) | const [pure virtual] |
Return EvolvableHolder that can be used to store information about evolvable objects that are not known during deserialization.
For example, it is possible to evolve the class hierarchy by adding new classes at any level in the hierarchy. Normally this would cause a problem during deserialization on older clients that don't have new classes at all, but EvolvableHolder allows us to work around that issue and simply store type id to opaque binary value mapping within it.