|
virtual | ~AbstractPersistenceInputStream () |
|
int | startStructWithVersion (const char *name=nullptr) |
| Starts a struct, returns the version of struct (0 if not given). More...
|
|
template<typename T > |
void | read (std::vector< T > &values, const char *name=nullptr) |
| Reads vectors of primitive values from the stream. More...
|
|
template<typename T , size_t n, class DataContainer > |
void | read (FloatingPointVector< T, n, DataContainer > &value, const char *name=nullptr) |
| Reads float vectors like vec3f from the stream. More...
|
|
template<typename T , size_t n> |
void | read (TVectorNDBase< T, n > &value, const char *name=nullptr) |
| Reads integer vectors like ImageVector from the stream. More...
|
|
template<typename T , size_t n> |
void | read (FloatingPointMatrix< T, n > &value, const char *name=nullptr) |
| Reads float matrices like mat4 from the stream. More...
|
|
template<typename T > |
void | readOptional (T &value, const T &defaultValue, const char *name=nullptr) |
| Performs optional reading for all above methods. More...
|
|
virtual Base * | readObject (const char *name=nullptr) |
| Reads Base object from stream. More...
|
|
virtual void | readData (std::string &value, const char *name=nullptr)=0 |
| Same as readObject for binary data (std::string misused as binary data container). More...
|
|
bool | hasNextInStruct (std::string &name) |
| Returns true if there is another element in the current struct scope, and if so, sets name to its name. More...
|
|
bool | isNextInStruct (const char *name) |
| Checks whether an item with the given name comes next in the stream. More...
|
|
bool | hasNextListItem () |
| Checks whether there is another item in the current list. More...
|
|
void | versionCheck (const char *className, int objectVersion, int storedVersion) |
| Prints a warning if the storedVersion is greater than the objectVersion. More...
|
|
|
virtual void | read (bool &value, const char *name=nullptr) |
| Reads primitive values from the stream. More...
|
|
void | read (MLint32 &value, const char *name=nullptr) |
|
void | read (MLuint32 &value, const char *name=nullptr) |
|
void | read (MLint64 &value, const char *name=nullptr) |
|
void | read (MLuint64 &value, const char *name=nullptr) |
|
void | read (MLfloat &value, const char *name=nullptr) |
|
void | read (MLdouble &value, const char *name=nullptr) |
|
void | read (std::string &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...
|
|
|
| AbstractPersistenceInputStream () |
|
virtual bool | hasNextInStructImpl (std::string &name)=0 |
| Checks whether an item with the given name comes next in the stream. More...
|
|
virtual bool | hasNextListItemImpl ()=0 |
| Checks whether there is another item in the current list. More...
|
|
virtual void | readString (const char *name, std::string &value)=0 |
| Abstract reading method that needs to be implemented by derived classes. More...
|
|
virtual void | formatError (const std::string &msg) |
| Indicates format error, by default, throw an exception. More...
|
|
|
virtual bool | getObjectID (int &id)=0 |
| Implementation of Base object persistence, get attribute of currently open struct. More...
|
|
virtual bool | getObjectType (std::string &type)=0 |
| Returns base type. More...
|
|
virtual bool | getObjectVersion (int &version)=0 |
| Returns persistence version. More...
|
|
|
virtual void | readValues (const char *name, size_t expected, std::vector< MLint32 > &values)=0 |
| Abstract reading methods that need to be implemented by derived classes. More...
|
|
virtual void | readValues (const char *name, size_t expected, std::vector< MLuint32 > &values)=0 |
|
virtual void | readValues (const char *name, size_t expected, std::vector< MLint64 > &values)=0 |
|
virtual void | readValues (const char *name, size_t expected, std::vector< MLuint64 > &values)=0 |
|
virtual void | readValues (const char *name, size_t expected, std::vector< MLfloat > &values)=0 |
|
virtual void | readValues (const char *name, size_t expected, std::vector< MLdouble > &values)=0 |
|
| AbstractPersistenceStream () |
|
virtual | ~AbstractPersistenceStream () |
|
virtual void | nameCheck (const char *name) |
| Checks whether the name is provided when being in a subgroup, or that no name is provided when being in a list. More...
|
|
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 reading object data from a stream.
This class has read methods for the types bool, MLint32, MLuint32, MLint64, MLuint64, float, double, std::string, and all vector and matrix types from MLLinearAlgebra. You can also read binary data (with readData()) and Base objects (with readObject()) from the stream.
You can use the readOptional() methods if a data item does not need to exist on the stream, but this is for convenience. You can always check with isNextInStruct() (for structure scopes) or hasNextListItem() (for list scopes) if the next item in the stream is as you expect. There is also the hasNextInStruct() method for getting the next item's name in a structure scope.
Definition at line 238 of file mlAbstractPersistenceStream.h.