Public Types | |
enum | SerializerType { Input = 0, Output = 1 } |
enum | Hint { Indent = 0, Unindent = 1 } |
Public Member Functions | |
Serializer (SerializerType type) | |
Serializer (SerializerType type, ref< VFile > archive) | |
Serializer (SerializerType type, std::ios &stream) | |
virtual | ~Serializer () |
virtual bool | isOutput () const |
true is this is an output serialization stream | |
virtual bool | isInput () const |
true if this is an input serialization stream | |
virtual bool | followReferences (bool follow) |
Serializer & | comment (const String &comment) |
emit comments into the serialization stream. Does nothing if not an output stream or the format doesn't support comments | |
virtual Serializer & | hint (Int h) |
provide a hint. The meaning is specific particular serializers and may be ignored/have no effect | |
Serializer & | operator() (char &c, const String &memberName="") |
Serializer & | operator() (const char &c, const String &memberName="") |
Serializer & | operator() (Byte &b, const String &memberName="") |
Serializer & | operator() (const Byte &b, const String &memberName="") |
Serializer & | operator() (bool &b, const String &memberName="") |
Serializer & | operator() (const bool &b, const String &memberName="") |
Serializer & | operator() (SInt &i, const String &memberName="") |
Serializer & | operator() (const SInt &i, const String &memberName="") |
Serializer & | operator() (Int &i, const String &memberName="") |
Serializer & | operator() (const Int &i, const String &memberName="") |
Serializer & | operator() (LInt &i, const String &memberName="") |
Serializer & | operator() (const LInt &i, const String &memberName="") |
Serializer & | operator() (Real &r, const String &memberName="") |
Serializer & | operator() (const Real &r, const String &memberName="") |
Serializer & | operator() (String &s, const String &memberName="") |
Serializer & | operator() (const String &s, const String &memberName="") |
Serializer & | operator() (Time &t, const String &memberName="") |
Serializer & | operator() (const Time &t, const String &memberName="") |
Serializer & | operator() (Vector3 &v, const String &memberName="") |
Serializer & | operator() (const Vector3 &v, const String &memberName="") |
Serializer & | operator() (Quat4 &q, const String &memberName="") |
Serializer & | operator() (const Quat4 &q, const String &memberName="") |
Serializer & | operator() (Orient &o, const String &memberName="") |
Serializer & | operator() (const Orient &o, const String &memberName="") |
Serializer & | operator() (Matrix3 &m, const String &memberName="") |
Serializer & | operator() (const Matrix3 &m, const String &memberName="") |
Serializer & | operator() (Matrix4 &m, const String &memberName="") |
Serializer & | operator() (const Matrix4 &m, const String &memberName="") |
Serializer & | operator() (Vector &v, const String &memberName="") |
Serializer & | operator() (const Vector &v, const String &memberName="") |
Serializer & | operator() (Matrix &m, const String &memberName="") |
Serializer & | operator() (const Matrix &m, const String &memberName="") |
Serializer & | operator() (Serializable &r, const String &memberName="") |
Serializer & | operator() (const Serializable &r, const String &memberName="") |
template<class T> Serializer & | operator() (ref< T > &r, const String &memberName="") |
template<class T> Serializer & | baseRef (ref< T > &r, const String &memberName="") |
template<class T> Serializer & | operator() (const ref< T > &r, const String &memberName="") |
template<class T> Serializer & | operator() (array< T > &a, const String &memberName="") |
template<class T> Serializer & | operator() (const array< T > &a, const String &memberName="") |
template<class T> Serializer & | operator() (std::list< T > &l, const String &memberName="") |
template<class T> Serializer & | operator() (const std::list< T > &a, const String &memberName="") |
template<class T> Serializer & | operator() (reflist< T > &l, const String &memberName="") |
template<class T> Serializer & | operator() (const reflist< T > &l, const String &memberName="") |
virtual void | flush ()=0 |
virtual bool | isSameKindAs (const Object &) const |
virtual String | className () const=0 |
Protected Types | |
enum | TypeModifier { UnknownType = 0, ObjectType = 1, ReferencedObjectType = 2, ObjectReferenceType = 3, InvalidType = 4 } |
Protected Member Functions | |
Serializer (const Serializer &s) | |
virtual void | serializeReferenceIndex (Int &index) |
virtual void | serializePointer (Serializable *&p, Serializable::SerializableInstantiator *i, const String &memberName, bool forceTypeSerialization=false) |
void | abort (const String &exceptionString) |
virtual Serializer & | serialize (char &c, const String &memberName)=0 |
virtual Serializer & | serialize (Byte &b, const String &memberName)=0 |
virtual Serializer & | serialize (bool &b, const String &memberName)=0 |
virtual Serializer & | serialize (SInt &i, const String &memberName)=0 |
virtual Serializer & | serialize (Int &i, const String &memberName)=0 |
virtual Serializer & | serialize (LInt &i, const String &memberName)=0 |
virtual Serializer & | serialize (String &s, const String &memberName)=0 |
virtual Serializer & | serialize (Real &r, const String &memberName)=0 |
virtual TypeModifier | preSerializeObject (String &typeName, TypeModifier typeModifier, const String &memberName, bool forceTypeSerialization=false)=0 |
serializes object or reference header | |
virtual void | postSerializeObject (const String &memberName)=0 |
serialize an object or reference 'footer' | |
virtual Serializer & | serialize (Serializable &r, const String &memberName) |
only override this to re-implement | |
virtual void | serializeComment (const String &comment) |
override this if the serialization format supports comments | |
Int | ptrIndex (Serializable *p) |
Protected Attributes | |
bool | output |
bool | follow |
bool | aborted |
array< Serializable * > | ptrs |
array< bool > | serialized |
Int | serializePointerRecursionDepth |
Int | depthAtFollowDisable |
Static Protected Attributes | |
const String | inputToConstErrorString |
|
Definition at line 109 of file Serializer. |
|
Definition at line 59 of file Serializer. |
|
Definition at line 412 of file Serializer. |
|
|
|
|
|
|
|
|
|
Definition at line 385 of file Serializer. |
|
Referenced by base::SimpleXMLSerializer::nextChar(), and base::SimpleXMLSerializer::nextNWSChar(). |
|
Definition at line 226 of file Serializer. References Assert, Exception, base::GetImplRef(), instanceof, output, base::Reset(), serializePointer(), and base::String. Referenced by base::UnaryOpExpression::serialize(), and base::BinaryOpExpression::serialize(). |
|
|
emit comments into the serialization stream. Does nothing if not an output stream or the format doesn't support comments The operator() method is overloaded for all types that can be serialized (including classes that derive from Serializable, in which case their serialize() method is called with *this Serializer). For example: (assuming class B is-a Serialiable) class A : public Serializable { public: int a; Real b ref c; B d; std::list<B> e; void serialize(Serializer& s) { s(a)(b)(c)(d)(e); } } The serialize() method will input or output (depending in the type of the Serializer s) the values a & b, will call c->serialize(s) if necessary (for example, on Output, if the object *c hasn't already been serialized), will call d.serialize() and also B::serialize(s) for each element of e. NB: all serialization operator() methods have undefined behavior for input streams that are exhausted, except char & Byte, which return std::EOF Definition at line 107 of file Serializer. References serializeComment(), and base::String. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
If follow is true (default) serialized references will cause the object being referenced to be serialized (if it hasn't been already). For complex data structures this recursive serialization of objects (and hence object they reference in turn), may cause excessive stack usage. If follow is false then the objects to which references refer will NOT be serialized. It is then up to the client to ensure that all referenced objects are ultimately serialized in the stream. Upon destruction, the Serializer *may* throw an exception if there are outstanding references to objects that have not been serialized. Returns the previous value (which most serialize() methods should restore before returning) Reimplemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
provide a hint. The meaning is specific particular serializers and may be ignored/have no effect
Reimplemented in base::SimpleXMLSerializer. Definition at line 111 of file Serializer. References base::Int. |
|
true if this is an input serialization stream
Definition at line 66 of file Serializer. References isOutput(). Referenced by robot::KinematicChain::serialize(), and robot::KinematicChain::Link::serialize(). |
|
true is this is an output serialization stream
Definition at line 65 of file Serializer. References output. Referenced by isInput(). |
|
|
|
Definition at line 374 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 343 of file Serializer. References base::reflist< _Tp, _Alloc >::begin(), base::reflist< _Tp, _Alloc >::clear(), base::reflist< _Tp, _Alloc >::end(), base::Int, operator()(), output, base::reflist< _Tp, _Alloc >::push_back(), serializeComment(), base::reflist< _Tp, _Alloc >::size(), and base::String. |
|
Definition at line 333 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 302 of file Serializer. References base::Int, operator()(), output, serializeComment(), and base::String. |
|
Definition at line 286 of file Serializer. References Exception, base::Int, operator()(), output, serializeComment(), base::array< T >::size(), and base::String. |
|
Definition at line 274 of file Serializer. References base::array< T >::at(), base::Int, operator()(), serializeComment(), base::array< T >::size(), and base::String. |
|
Definition at line 254 of file Serializer. References Exception, base::GetImplRef(), instanceof, output, serializePointer(), and base::String. |
|
Definition at line 200 of file Serializer. References Assert, Exception, base::GetImplRef(), instanceof, output, base::Reset(), serializePointer(), and base::String. |
|
Definition at line 194 of file Serializer. References Exception, output, serialize(), and base::String. |
|
Definition at line 193 of file Serializer. References serialize(), and base::String. |
|
Definition at line 184 of file Serializer. References Exception, base::Matrix, operator()(), output, and base::String. |
|
|
|
Definition at line 180 of file Serializer. References Exception, operator()(), output, base::String, and base::Vector. |
|
|
|
Definition at line 176 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 174 of file Serializer. References base::Matrix4::serialize(), and base::String. |
|
Definition at line 171 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 169 of file Serializer. References base::Matrix3::serialize(), and base::String. |
|
Definition at line 166 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 164 of file Serializer. References base::Orient::serialize(), and base::String. |
|
Definition at line 161 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 159 of file Serializer. References base::Quat4::serialize(), and base::String. |
|
Definition at line 156 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 154 of file Serializer. References base::Vector3::serialize(), and base::String. |
|
Definition at line 151 of file Serializer. References Exception, operator()(), output, and base::String. |
|
Definition at line 149 of file Serializer. References base::Time::serialize(), and base::String. |
|
Definition at line 146 of file Serializer. References Exception, output, serialize(), and base::String. |
|
Definition at line 145 of file Serializer. References serialize(), and base::String. |
|
Definition at line 140 of file Serializer. References Exception, output, base::Real, serialize(), and base::String. |
|
Definition at line 139 of file Serializer. References base::Real, serialize(), and base::String. |
|
Definition at line 136 of file Serializer. References Exception, base::LInt, output, serialize(), and base::String. |
|
Definition at line 135 of file Serializer. References base::LInt, serialize(), and base::String. |
|
Definition at line 132 of file Serializer. References Exception, base::Int, output, serialize(), and base::String. |
|
Definition at line 131 of file Serializer. References base::Int, serialize(), and base::String. |
|
Definition at line 128 of file Serializer. References Exception, output, serialize(), base::SInt, and base::String. |
|
Definition at line 127 of file Serializer. References serialize(), base::SInt, and base::String. |
|
Definition at line 124 of file Serializer. References Exception, output, serialize(), and base::String. |
|
Definition at line 123 of file Serializer. References serialize(), and base::String. |
|
Definition at line 120 of file Serializer. References base::Byte, Exception, output, serialize(), and base::String. |
|
Definition at line 119 of file Serializer. References base::Byte, serialize(), and base::String. |
|
Definition at line 116 of file Serializer. References Exception, output, serialize(), and base::String. |
|
Definition at line 115 of file Serializer. References serialize(), and base::String. Referenced by operator()(), and serializeReferenceIndex(). |
|
serialize an object or reference 'footer' Called just after an object or reference has been serialized (by serialize(Serializable&) or serializePointer() ). Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
serializes object or reference header Typically serializes the object or reference type (at minimum a flag indicating if a referenced object is present in the stream, or just an object reference). Called just before an object or reference is serialized (by serialize(Serializable&) or serializePointer() ).
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
|
|
only override this to re-implement
|
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. |
|
Implemented in base::BinarySerializer, and base::SimpleXMLSerializer. Referenced by operator()(). |
|
override this if the serialization format supports comments
Reimplemented in base::SimpleXMLSerializer. Definition at line 467 of file Serializer. References base::String. Referenced by comment(), and operator()(). |
|
Referenced by baseRef(), and operator()(). |
|
Definition at line 390 of file Serializer. References base::Int, and operator()(). |
|
Definition at line 474 of file Serializer. |
|
Definition at line 481 of file Serializer. |
|
Definition at line 473 of file Serializer. Referenced by Serializer(). |
|
Definition at line 387 of file Serializer. |
|
Definition at line 472 of file Serializer. Referenced by baseRef(), isOutput(), operator()(), and Serializer(). |
|
Definition at line 478 of file Serializer. |
|
Definition at line 479 of file Serializer. |
|
Definition at line 480 of file Serializer. |