|
| ~AbstractPersistenceOutputStream () override=default |
|
void | startStructWithVersion (int version, const char *name=nullptr) |
| Starts a versioned struct. More...
|
|
template<typename T > |
void | write (const std::vector< T > &values, const char *name=nullptr) |
| Writes vectors of primitive values to the stream. More...
|
|
template<typename T , size_t n, class DataContainer > |
void | write (const FloatingPointVector< T, n, DataContainer > &value, const char *name=nullptr) |
| Writes float vectors like vec3f to the stream. More...
|
|
template<typename T , size_t n> |
void | write (const TVectorNDBase< T, n > &value, const char *name=nullptr) |
| Writes integer vectors like ImageVector to the stream. More...
|
|
template<typename T , size_t n> |
void | write (const FloatingPointMatrix< T, n > &value, const char *name=nullptr) |
| Writes float matrices like mat4 to the stream. More...
|
|
virtual void | writeObject (const Base *const obj, const char *name=nullptr) |
| Writes a Base object to the stream. More...
|
|
virtual void | writeData (const void *data, size_t len, const char *name=nullptr)=0 |
| Writes binary data to stream. More...
|
|
virtual bool | isValidElementName (const char *name) |
| Checks whether name is valid for use with persistence entries. More...
|
|
|
virtual void | write (bool value, const char *name=nullptr) |
| Writes primitive values to the stream. More...
|
|
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) |
| Starts a new list of values in the data stream, must be ended with endList(). More...
|
|
void | endList () |
| Ends reading/writing of the list. More...
|
|
void | startStruct (const char *name=nullptr) |
| Starts a new struct of values in the data stream, must be ended with endStruct(). More...
|
|
void | endStruct () |
| Ends reading/writing of struct values. More...
|
|
virtual bool | isBinary () const =0 |
| Is the stream in a binary format? Otherwise, it is in a human-readable text format. More...
|
|
|
| AbstractPersistenceOutputStream () |
|
virtual void | writeString (const char *name, const std::string &value)=0 |
| Abstract writing method that needs to be implemented by derived classes. More...
|
|
void | nameCheck (const char *name) override |
| Overridden to perform an additional check in Debug mode if name is suitable for the persistence format (uses isValidElementName), prints an error if not. More...
|
|
|
virtual void | setObjectID (int id)=0 |
| Implementation of Base object persistence, sets 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. More...
|
|
virtual void | setObjectType (const char *type)=0 |
| Sets base type. More...
|
|
virtual void | setObjectVersion (int version)=0 |
| Sets persistence version. More...
|
|
|
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. More...
|
|
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 |
| Checks whether the stream is currently in 'list' mode. Otherwise, it is in 'struct' mode. More...
|
|
size_t | nestingDepth () const |
| Returns depth of nesting stack (created by startList/startStruct), used to check nesting rules. More...
|
|
virtual void | internalError (const char *msg, const char *arg=nullptr) |
| Logs an internal error. Usually called to indicate wrong usage of interface. More...
|
|
virtual void | startListImpl (const char *name, const char *xmlItemName, bool xmlSuppressScope)=0 |
| Abstract methods called by above methods, needs to be implemented in derived classes. More...
|
|
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 substructures 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.
template<typename T >
void ml::AbstractPersistenceOutputStream::write |
( |
const std::vector< T > & |
values, |
|
|
const char * |
name = nullptr |
|
) |
| |
|
inline |
Writes vectors of primitive values to the stream.
Currently supported are MLint32, MLuint32, MLint64, MLuint64, MLfloat, and MLdouble.
Definition at line 147 of file mlAbstractPersistenceStream.h.