class ReflectExport( reflect ) Reflector
Reflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling.
Reflectors do the dirty job of invoking the template Serialize<T>(...) functions.
Reflector | Reflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling. |
Functions | |
Reflector | Builds a serializing reflector |
Reflector | Builds a deserializing reflector |
operator | | Serializes or Deserializes data. |
operator | | Serializes the data. |
operator | | Serializes or Deserializes a pointer to a subclass of Dynamic. |
operator | | Serializes a pointer to a subclass of Dynamic. |
Serializing | true when this reflector represents a Serializer |
Deserializing | true when this reflector represents a Deserializer |
operator Serializer | returns the serializer represented by this Reflector |
operator Deserializer | returns the deserializer represented by this Reflector |
GetSerializer | returns the serializer represented by this Reflector |
GetDeserializer | returns the deserializer represented by this Reflector |
Fail | Flag an error condition on this Reflector. |
Check | Flag an error condition on this Reflector if result is false. |
Ok | true if an error has not been flagged on this reflector. |
operator bool | convenient alias for Ok |
operator(const T *, T *) | a Reflector bound to an object which can serialize pointer-to-members bidirectionally. |
OpaqueSerialize | Helper function for invoking <Class::Serialize> which takes void * arguments which need to be normalized with opaque_cast so the implementation can cast back safely. |
Members | |
mSerializer | The serializer this Reflector is managing, or NULL if it is Deserializing. |
mDeserializer | The deserializer this Reflector is managing, or NULL if it is Serializing. |
mOk | A bool indicating success, if this becomes false then there was a problem with serialization/deserialization. |
Reflector:: | A utitlity class which makes it easier to sequence reads and writes of multiple member variables. |
operator bool() const
convenient alias for Ok
template<typename T> static inline void OpaqueSerialize( const T * in, T * out, Reflector & reflector )
Helper function for invoking <Class::Serialize> which takes void * arguments which need to be normalized with opaque_cast so the implementation can cast back safely.
in | const T * to be serialized. |
out | T * to be deserialized (may be null if serializing). |
reflector | wraps a serializer or deserializer. |
Reflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling.
class ReflectExport( reflect ) Reflector
Defines the interface for serialization.
class ReflectExport( reflect ) Serializer
Defines the interface for deserialization.
class ReflectExport( reflect ) Deserializer
Builds a serializing reflector
Reflector( Serializer & )
Serializes or Deserializes data.
template<typename T> Reflector &operator |( T & data )
true when this reflector represents a Serializer
bool Serializing() const
true when this reflector represents a Deserializer
bool Deserializing() const
returns the serializer represented by this Reflector
operator Serializer &() const
returns the deserializer represented by this Reflector
operator Deserializer &() const
returns the serializer represented by this Reflector
Serializer &GetSerializer() const
returns the deserializer represented by this Reflector
Deserializer &GetDeserializer() const
Flag an error condition on this Reflector.
void Fail()
Flag an error condition on this Reflector if result is false.
Reflector &Check( bool result )
true if an error has not been flagged on this reflector.
bool Ok() const
convenient alias for Ok
operator bool() const
a Reflector bound to an object which can serialize pointer-to-members bidirectionally.
template<typename T> BoundReflector<T> operator( )(const T *in, T *out)
Helper function for invoking Class::Serialize which takes void * arguments which need to be normalized with opaque_cast so the implementation can cast back safely.
template<typename T> static inline void OpaqueSerialize( const T * in, T * out, Reflector & reflector )
Turns a typed pointer (of type Type *) into an opaque pointer (a void *), for use with the class Signature::TheClass.
template<typename T> inline void *opaque_cast( T * value )
The serializer this Reflector is managing, or NULL if it is Deserializing.
Serializer *mSerializer
The deserializer this Reflector is managing, or NULL if it is Serializing.
Deserializer *mDeserializer
A utitlity class which makes it easier to sequence reads and writes of multiple member variables.
template<typename T> class Reflector::BoundReflector