Public Types | |
enum | SerializerType { Input = 0, Output = 1 } |
enum | Hint { Indent = 0, Unindent = 1 } |
Public Member Functions | |
BinarySerializer (SerializerType type, ref< VFile > archive) | |
BinarySerializer (SerializerType type, std::ios &stream) | |
virtual | ~BinarySerializer () |
virtual String | className () const |
virtual bool | followReferences (bool follow) |
virtual void | flush () |
flush output stream (no-op on input). Should use this before closing an output file before Serializer goes out-of-scope. | |
virtual bool | isOutput () const |
true is this is an output serialization stream | |
virtual bool | isInput () const |
true if this is an input serialization stream | |
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 & | 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="") |
template<class T> Serializer & | baseRef (ref< T > &r, const String &memberName="") |
virtual bool | isSameKindAs (const Object &) const |
Protected Types | |
enum | TypeModifier { UnknownType = 0, ObjectType = 1, ReferencedObjectType = 2, ObjectReferenceType = 3, InvalidType = 4 } |
Protected Member Functions | |
BinarySerializer (const BinarySerializer &a) | |
virtual Serializer & | serialize (char &c, const String &memberName) |
virtual Serializer & | serialize (Byte &b, const String &memberName) |
virtual Serializer & | serialize (bool &b, const String &memberName) |
virtual Serializer & | serialize (SInt &i, const String &memberName) |
virtual Serializer & | serialize (Int &i, const String &memberName) |
virtual Serializer & | serialize (LInt &i, const String &memberName) |
virtual Serializer & | serialize (String &s, const String &memberName) |
virtual Serializer & | serialize (Real &r, const String &memberName) |
virtual TypeModifier | preSerializeObject (String &typeName, TypeModifier typeModifier, const String &memberName, bool forceTypeSerialization=false) |
serializes object or reference header | |
virtual void | postSerializeObject (const String &memberName) |
serialize an object or reference 'footer' | |
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 (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 | |
std::ios & | stream |
std::streambuf & | buf |
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 49 of file BinarySerializer. References buf. |
|
Referenced by base::SimpleXMLSerializer::nextChar(), and base::SimpleXMLSerializer::nextNWSChar(). |
|
Definition at line 226 of file Serializer. References Assert, Exception, base::GetImplRef(), instanceof, base::Serializer::output, base::Reset(), base::Serializer::serializePointer(), and base::String. Referenced by base::UnaryOpExpression::serialize(), and base::BinaryOpExpression::serialize(). |
|
return the name of the object's class type. Must be defined by derived classes. Implements base::Object. Definition at line 43 of file BinarySerializer. References base::String. |
|
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 base::Serializer::serializeComment(), and base::String. |
|
flush output stream (no-op on input). Should use this before closing an output file before Serializer goes out-of-scope.
Implements base::Serializer. |
|
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 from base::Serializer. |
|
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 base::Serializer::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 base::Serializer::output. Referenced by base::Serializer::isInput(). |
|
|
|
Definition at line 374 of file Serializer. References Exception, base::Serializer::operator()(), base::Serializer::output, and base::String. |
|
|
Definition at line 333 of file Serializer. References Exception, base::Serializer::operator()(), base::Serializer::output, and base::String. |
|
Definition at line 302 of file Serializer. References base::Int, base::Serializer::operator()(), base::Serializer::output, base::Serializer::serializeComment(), and base::String. |
|
Definition at line 286 of file Serializer. References Exception, base::Int, base::Serializer::operator()(), base::Serializer::output, base::Serializer::serializeComment(), base::array< T >::size(), and base::String. |
|
Definition at line 274 of file Serializer. References base::array< T >::at(), base::Int, base::Serializer::operator()(), base::Serializer::serializeComment(), base::array< T >::size(), and base::String. |
|
Definition at line 254 of file Serializer. References Exception, base::GetImplRef(), instanceof, base::Serializer::output, base::Serializer::serializePointer(), and base::String. |
|
Definition at line 200 of file Serializer. References Assert, Exception, base::GetImplRef(), instanceof, base::Serializer::output, base::Reset(), base::Serializer::serializePointer(), and base::String. |
|
Definition at line 194 of file Serializer. References Exception, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 193 of file Serializer. References base::Serializer::serialize(), and base::String. |
|
Definition at line 184 of file Serializer. References Exception, base::Matrix, base::Serializer::operator()(), base::Serializer::output, and base::String. |
|
|
|
Definition at line 180 of file Serializer. References Exception, base::Serializer::operator()(), base::Serializer::output, base::String, and base::Vector. |
|
|
|
Definition at line 176 of file Serializer. References Exception, base::Serializer::operator()(), base::Serializer::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, base::Serializer::operator()(), base::Serializer::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, base::Serializer::operator()(), base::Serializer::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, base::Serializer::operator()(), base::Serializer::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, base::Serializer::operator()(), base::Serializer::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, base::Serializer::operator()(), base::Serializer::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, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 145 of file Serializer. References base::Serializer::serialize(), and base::String. |
|
Definition at line 140 of file Serializer. References Exception, base::Serializer::output, base::Real, base::Serializer::serialize(), and base::String. |
|
Definition at line 139 of file Serializer. References base::Real, base::Serializer::serialize(), and base::String. |
|
Definition at line 136 of file Serializer. References Exception, base::LInt, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 135 of file Serializer. References base::LInt, base::Serializer::serialize(), and base::String. |
|
Definition at line 132 of file Serializer. References Exception, base::Int, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 131 of file Serializer. References base::Int, base::Serializer::serialize(), and base::String. |
|
Definition at line 128 of file Serializer. References Exception, base::Serializer::output, base::Serializer::serialize(), base::SInt, and base::String. |
|
Definition at line 127 of file Serializer. References base::Serializer::serialize(), base::SInt, and base::String. |
|
Definition at line 124 of file Serializer. References Exception, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 123 of file Serializer. References base::Serializer::serialize(), and base::String. |
|
Definition at line 120 of file Serializer. References base::Byte, Exception, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 119 of file Serializer. References base::Byte, base::Serializer::serialize(), and base::String. |
|
Definition at line 116 of file Serializer. References Exception, base::Serializer::output, base::Serializer::serialize(), and base::String. |
|
Definition at line 115 of file Serializer. References base::Serializer::serialize(), and base::String. Referenced by base::Serializer::operator()(), and base::Serializer::serializeReferenceIndex(). |
|
serialize an object or reference 'footer' Called just after an object or reference has been serialized (by serialize(Serializable&) or serializePointer() ). Implements base::Serializer. Definition at line 62 of file BinarySerializer. References base::String. |
|
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() ).
Implements base::Serializer. |
|
|
|
only override this to re-implement
|
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
Implements base::Serializer. |
|
override this if the serialization format supports comments
Reimplemented in base::SimpleXMLSerializer. Definition at line 467 of file Serializer. References base::String. Referenced by base::Serializer::comment(), and base::Serializer::operator()(). |
|
Referenced by base::Serializer::baseRef(), and base::Serializer::operator()(). |
|
Definition at line 390 of file Serializer. References base::Int, and base::Serializer::operator()(). |
|
Definition at line 474 of file Serializer. |
|
Definition at line 65 of file BinarySerializer. Referenced by BinarySerializer(). |
|
Definition at line 481 of file Serializer. |
|
Definition at line 473 of file Serializer. Referenced by base::Serializer::Serializer(). |
|
Definition at line 387 of file Serializer. |
|
Definition at line 472 of file Serializer. Referenced by base::Serializer::baseRef(), base::Serializer::isOutput(), base::Serializer::operator()(), and base::Serializer::Serializer(). |
|
Definition at line 478 of file Serializer. |
|
Definition at line 479 of file Serializer. |
|
Definition at line 480 of file Serializer. |
|
Definition at line 64 of file BinarySerializer. |