#include <coherence/io/pof/SimplePofContext.hpp>
Inherits Object, and PofContext.
Inherited by SystemPofContext.
Public Types | |||||||
typedef spec::Handle | Handle | ||||||
SimplePofContext Handle definition. | |||||||
typedef spec::View | View | ||||||
SimplePofContext View definition. | |||||||
typedef spec::Holder | Holder | ||||||
SimplePofContext Holder definition. | |||||||
Public Member Functions | |||||||
virtual void | registerUserType (int32_t nTypeId, Class::View vClass, PofSerializer::View vSerializer) | ||||||
Associate a user type with a type identifier and PofSerializer. | |||||||
virtual void | unregisterUserType (int32_t nTypeId) | ||||||
Unregister a user type previously registered using the specified type identifier. | |||||||
virtual PofSerializer::View | getPofSerializer (int32_t nTypeId) const | ||||||
Return a PofSerializer that can be used to serialize and deserialize an objectof the specified user type to and from a POF stream.
| |||||||
virtual int32_t | getUserTypeIdentifier (Object::View v) const | ||||||
Determine the user type identifier associated with the given object.
| |||||||
virtual int32_t | getUserTypeIdentifier (Class::View vClass) const | ||||||
Determine the user type identifier associated with the given class.
| |||||||
virtual int32_t | getUserTypeIdentifier (String::View vsClass) const | ||||||
Determine the user type identifier associated with the given class name.
| |||||||
virtual String::View | getClassName (int32_t nTypeId) const | ||||||
Determine the name of the class associated with the given user type identifier.
| |||||||
virtual Class::View | getClass (int32_t nTypeId) const | ||||||
Determine the class associated with the given user type identifier.
| |||||||
virtual bool | isUserType (Object::View v) const | ||||||
Determine if the given object is an instance of a user type known to this PofContext.
| |||||||
virtual bool | isUserType (Class::View vClass) const | ||||||
Determine if the given class is a user type known to this PofContext.
| |||||||
virtual bool | isUserType (String::View vsClass) const | ||||||
Determine if the class with the given name is a user type known to this PofContext.
| |||||||
virtual void | serialize (WriteBuffer::BufferOutput::Handle hOut, Object::View v) const | ||||||
Serialize an object to a WriteBuffer by writing its state using the specified BufferOutput object.
| |||||||
virtual Object::Holder | deserialize (ReadBuffer::BufferInput::Handle hIn) const | ||||||
Deserialize an object from a ReadBuffer by reading its state using the specified BufferInput object.
| |||||||
virtual void | toStream (std::ostream &out) const | ||||||
Output a human-readable description of this Object to the given stream. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
| |||||||
Protected Member Functions | |||||||
virtual void | validateTypeId (int32_t nTypeId) const | ||||||
Ensure that the given user type identifier is valid. | |||||||
Protected Attributes | |||||||
FinalHandle< LongArray > | m_hlaClass | ||||||
A LongArray of user types, indexed by type identifier. | |||||||
FinalHandle< LongArray > | m_hlaSerializer | ||||||
A LongArray of PofSerializer objects, indexed by type identifier. | |||||||
FinalHandle< Map > | m_hMapClassName | ||||||
A Map that contains mappings from a registered class name to type identifier. | |||||||
FinalHandle< ThreadGate > | m_hGate | ||||||
ThreadGate used to synchronize access to this PofContext. |
virtual void registerUserType | ( | int32_t | nTypeId, | |
Class::View | vClass, | |||
PofSerializer::View | vSerializer | |||
) | [virtual] |
Associate a user type with a type identifier and PofSerializer.
nTypeId | the type identifier of the specified user type; must be greater or equal to 0 | |
vClass | the user type to register with this PofContext; must not be NULL | |
vSerializer | the PofSerializer that will be used to serialize and deserialize objects of the specified class; must not be NULL |
coherence::lang::IllegalArgumentException | on invalid type identifer, class, or PofSerializer |
virtual void unregisterUserType | ( | int32_t | nTypeId | ) | [virtual] |
Unregister a user type previously registered using the specified type identifier.
nTypeId | the type identifier of the user type to unregister |
coherence::lang::IllegalArgumentException | if the specified user type identifier is unknown to this PofContext |
virtual void validateTypeId | ( | int32_t | nTypeId | ) | const [protected, virtual] |
Ensure that the given user type identifier is valid.
nTypeId | the user type identifier to validate |
coherence::lang::IllegalArgumentException | if the given user type identifier is negative |