|
| ~AbstractPersistenceOutputStream () override=default |
|
void | startStructWithVersion (int version, const char *name=nullptr) |
| start a versioned struct
|
|
template<typename T > |
void | write (const std::vector< T > &values, const char *name=nullptr) |
| Write vectors of primitive values to the stream.
|
|
template<typename T , size_t n, class DataContainer > |
void | write (const FloatingPointVector< T, n, DataContainer > &value, const char *name=nullptr) |
| Write float vectors like vec3f to the stream.
|
|
template<typename T , size_t n> |
void | write (const TVectorNDBase< T, n > &value, const char *name=nullptr) |
| Write integer vectors like ImageVector to the stream.
|
|
template<typename T , size_t n> |
void | write (const FloatingPointMatrix< T, n > &value, const char *name=nullptr) |
| Write float matrices like mat4 to the stream.
|
|
virtual void | writeObject (const Base *const obj, const char *name=nullptr) |
| Write a Base object to the stream.
|
|
virtual void | writeData (const void *data, size_t len, const char *name=nullptr)=0 |
| Write binary data to stream.
|
|
virtual bool | isValidElementName (const char *name) |
| check if name is valid for use with persistence entries (by default this checks if the name is valid for use as a XML tag, but implementations may relax - or tighten - this check)
|
|
|
virtual void | write (bool value, const char *name=nullptr) |
| Write primitive values to the stream.
|
|
void | write (MLint32 value, const char *name=nullptr) |
|
void | write (MLuint32 value, const char *name=nullptr) |
|
void | write (MLint64 value, const char *name=nullptr) |
|
void | write (MLuint64 value, const char *name=nullptr) |
|
void | write (MLfloat value, const char *name=nullptr) |
|
void | write (MLdouble value, const char *name=nullptr) |
|
void | write (const std::string &value, const char *name=nullptr) |
|
void | write (const char *value, const char *name=nullptr) |
|
void | startList (const char *name=nullptr, const char *xmlItemName="Item", bool xmlSuppressScope=false) |
| Start a new list of values in the data stream, must be ended with endList().
|
|
void | endList () |
| End reading/writing of the list.
|
|
void | startStruct (const char *name=nullptr) |
| Start a new struct of values in the data stream, must be ended with endStruct().
|
|
void | endStruct () |
| End reading/writing of struct values.
|
|
virtual bool | isBinary () const =0 |
| Is the stream in a binary format? (otherwise in a readable text format)
|
|
|
| AbstractPersistenceOutputStream () |
|
virtual void | writeString (const char *name, const std::string &value)=0 |
| Abstract writing method that needs to be implemented by derived classes.
|
|
void | nameCheck (const char *name) override |
| overriden to perform additional check in Debug mode if name is suitable for the persistence format (uses isValidElementName), prints an error if not
|
|
|
virtual void | setObjectID (int id)=0 |
| Implementation of Base object persistence, set attribute on currently open struct (implementation hint: these can be stored unnamed, if they are read or not is always deduced from the current state of the persistence stream)unique id for each pointer value - currently unused.
|
|
virtual void | setObjectType (const char *type)=0 |
| base type name
|
|
virtual void | setObjectVersion (int version)=0 |
| persistence version
|
|
|
virtual void | writeValues (const char *name, const MLint32 *values, size_t n, bool fixedList)=0 |
| Abstract writing methods that need to be implemented by derived classes.
|
|
virtual void | writeValues (const char *name, const MLuint32 *values, size_t n, bool fixedList)=0 |
|
virtual void | writeValues (const char *name, const MLint64 *values, size_t n, bool fixedList)=0 |
|
virtual void | writeValues (const char *name, const MLuint64 *values, size_t n, bool fixedList)=0 |
|
virtual void | writeValues (const char *name, const MLfloat *values, size_t n, bool fixedList)=0 |
|
virtual void | writeValues (const char *name, const MLdouble *values, size_t n, bool fixedList)=0 |
|
| AbstractPersistenceStream () |
|
virtual | ~AbstractPersistenceStream () |
|
bool | isInList () const |
| Check if the stream is currently in "list" mode. Otherwise it is in "struct" mode.
|
|
size_t | nestingDepth () const |
| return depth of nesting stack (created by startList/startStruct), used to check nesting rules
|
|
virtual void | internalError (const char *msg, const char *arg=nullptr) |
| Log an internal error. Usually called to indicate wrong usage of interface.
|
|
virtual void | startListImpl (const char *name, const char *xmlItemName, bool xmlSuppressScope)=0 |
| Abstract methods called by above methods, need to be implemented in derived classes.
|
|
virtual void | endListImpl ()=0 |
|
virtual void | startStructImpl (const char *name)=0 |
|
virtual void | endStructImpl ()=0 |
|
Class for writing object data to a stream.
This class has write methods for the types bool, MLint32, MLuint32, MLint64, MLuint64, float, double, std::string and all vector and matrix types from MLLinearAlgebra. You can also write binary data (with writeData()) and Base objects (with writeObject()) to the stream.
Data can be organized in sub-structures or in lists. Data items usually have to be given a name, unless they are list items, in which case it is forbidden to give a name. Have a look at the startStruct()/endStruct() startList()/endList() methods of AbstractPersistenceStream on how to start/end new scopes.
Definition at line 120 of file mlAbstractPersistenceStream.h.