Reflector

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.

Summary
ReflectorReflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling.
Functions
ReflectorBuilds a serializing reflector
ReflectorBuilds 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.
Serializingtrue when this reflector represents a Serializer
Deserializingtrue when this reflector represents a Deserializer
operator Serializerreturns the serializer represented by this Reflector
operator Deserializerreturns the deserializer represented by this Reflector
GetSerializerreturns the serializer represented by this Reflector
GetDeserializerreturns the deserializer represented by this Reflector
FailFlag an error condition on this Reflector.
CheckFlag an error condition on this Reflector if result is false.
Oktrue if an error has not been flagged on this reflector.
operator boolconvenient alias for Ok
operator(const T *, T *)a Reflector bound to an object which can serialize pointer-to-members bidirectionally.
OpaqueSerializeHelper 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
mSerializerThe serializer this Reflector is managing, or NULL if it is Deserializing.
mDeserializerThe deserializer this Reflector is managing, or NULL if it is Serializing.
mOkA bool indicating success, if this becomes false then there was a problem with serialization/deserialization.
Reflector::BoundReflectorA utitlity class which makes it easier to sequence reads and writes of multiple member variables.

Functions

Reflector

Reflector(Serializer &)

Builds a serializing reflector

Reflector

Reflector(Deserializer &)

Builds a deserializing reflector

operator |

template<typename T> Reflector &operator |(&data)

Serializes or Deserializes data.

operator |

template<typename T> Reflector &operator |(const &data)

Serializes the data.

operator |

template<typename T> Reflector &operator |(*&data)

Serializes or Deserializes a pointer to a subclass of Dynamic.

operator |

template<typename T> Reflector &operator |(*const &data)

Serializes a pointer to a subclass of Dynamic.

Serializing

bool Serializing() const

Return

true when this reflector represents a Serializer

Deserializing

bool Deserializing() const

Return

true when this reflector represents a Deserializer

operator Serializer

operator Serializer &() const

returns the serializer represented by this Reflector

operator Deserializer

operator Deserializer &() const

returns the deserializer represented by this Reflector

GetSerializer

Serializer &GetSerializer() const

returns the serializer represented by this Reflector

GetDeserializer

Deserializer &GetDeserializer() const

returns the deserializer represented by this Reflector

Fail

void Fail()

Flag an error condition on this Reflector.

Check

Reflector &Check(bool result)

Flag an error condition on this Reflector if result is false.

Ok

bool Ok() const

Return

true if an error has not been flagged on this reflector.

operator bool

operator bool() const

convenient alias for Ok

operator(const T *, T *)

template<typename T> BoundReflector<T> operator()(const T *in, T *out)

Returns

a Reflector bound to an object which can serialize pointer-to-members bidirectionally.

OpaqueSerialize

template<typename T> static inline void OpaqueSerialize(const *in,
*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.

Parameters

inconst T * to be serialized.
outT * to be deserialized (may be null if serializing).
reflectorwraps a serializer or deserializer.

Members

mSerializer

Serializer *mSerializer

The serializer this Reflector is managing, or NULL if it is Deserializing.

mDeserializer

Deserializer *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::BoundReflector

template<typename T> class Reflector::BoundReflector

A utitlity class which makes it easier to sequence reads and writes of multiple member variables.

class ReflectExport(reflect) Reflector
Reflectors provides an easy and uniform interface for using Serializers, and Deserializers, and maintain a bool for error detection/handling.
class ReflectExport(reflect) Serializer
Defines the interface for serialization.
class ReflectExport(reflect) Deserializer
Defines the interface for deserialization.
Reflector(Serializer &)
Builds a serializing reflector
template<typename T> Reflector &operator |(&data)
Serializes or Deserializes data.
bool Serializing() const
true when this reflector represents a Serializer
bool Deserializing() const
true when this reflector represents a Deserializer
operator Serializer &() const
returns the serializer represented by this Reflector
operator Deserializer &() const
returns the deserializer represented by this Reflector
Serializer &GetSerializer() const
returns the serializer represented by this Reflector
Deserializer &GetDeserializer() const
returns the deserializer represented by this Reflector
void Fail()
Flag an error condition on this Reflector.
Reflector &Check(bool result)
Flag an error condition on this Reflector if result is false.
bool Ok() const
true if an error has not been flagged on this reflector.
operator bool() const
convenient alias for Ok
template<typename T> BoundReflector<T> operator()(const T *in, T *out)
a Reflector bound to an object which can serialize pointer-to-members bidirectionally.
template<typename T> static inline void OpaqueSerialize(const *in,
*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.
template<typename T> inline void *opaque_cast(*value)
Turns a typed pointer (of type Type *) into an opaque pointer (a void *), for use with the class Signature::TheClass.
Serializer *mSerializer
The serializer this Reflector is managing, or NULL if it is Deserializing.
Deserializer *mDeserializer
The deserializer this Reflector is managing, or NULL if it is Serializing.
template<typename T> class Reflector::BoundReflector
A utitlity class which makes it easier to sequence reads and writes of multiple member variables.
Close