MeVisLab Toolbox Reference
|
The class TreeNode is the abstract base class for the import/export of ML objects. More...
#include <mlTreeNode.h>
Public Types | |
enum | ConstructionMode { CM_writerRoot , CM_readerRoot , CM_COUNT } |
TreeNode construction modes: More... | |
Public Member Functions | |
virtual | ~TreeNode () |
Destructor deleting all children of this node. | |
TREE IMPORT/EXPORT METHODS: | |
Re-implement in derived classes. | |
virtual void | writeToFile (const char *) VOID_IMPLEMENTATION("writeToFile") |
Writes the subtree represented by this node to a file. | |
virtual void | readFromFile (const char *) VOID_IMPLEMENTATION("readFromFile") |
Reads the subtree represented by this node from a file. | |
virtual void | writeToString (std::string &) VOID_IMPLEMENTATION("writeToString") |
Generates a string representation of the subtree represented by this node to a file. | |
virtual void | readFromString (const std::string &) VOID_IMPLEMENTATION("readFromString") |
Reads the subtree represented by this node from a string. | |
TREE WRITING METHODS: | |
Each method appends a child representing the variable/object given as first parameter and identified via the second. You can also add several children with the same name. This feature should be used with care though, because it is not specified here whether the implementation preserves the object order while reading and writing. Those methods with VOID_IMPLEMENTATION must be reimplemented when used in derived classes. The first parameter is the value to be stored and the second holds a name for it (for example a tag name in XML files. | |
virtual void | addChild (bool val, const char *name) ADD_ULONG_CHILD |
Factory method adding a child encapsulating a variable of type bool. | |
virtual void | addChild (unsigned char val, const char *name) ADD_ULONG_CHILD |
Factory method adding a child encapsulating a variable of type unsigned char. | |
virtual void | addChild (char val, const char *name) ADD_LONG_CHILD |
Factory method adding a child encapsulating a variable of type char. | |
virtual void | addChild (unsigned short val, const char *name) ADD_ULONG_CHILD |
Factory method adding a child encapsulating a variable of type unsigned short. | |
virtual void | addChild (short val, const char *name) ADD_LONG_CHILD |
Factory method adding a child encapsulating a variable of type short. | |
virtual void | addChild (unsigned int val, const char *name) ADD_ULONG_CHILD |
Factory method adding a child encapsulating a variable of type unsigned int. | |
virtual void | addChild (int val, const char *name) ADD_LONG_CHILD |
Factory method adding a child encapsulating a variable of type int. | |
virtual void | addChild (unsigned long, const char *) VOID_IMPLEMENTATION("addChild(unsigned long)") |
Factory method adding a child encapsulating a variable of type long. | |
virtual void | addChild (long, const char *) VOID_IMPLEMENTATION("addChild(long)") |
Factory method adding a child encapsulating a variable of type long. | |
virtual void | addChild (MLuint64, const char *) VOID_IMPLEMENTATION("addChild(MLuint64)") |
Factory method adding a child encapsulating a variable of type MLuint64. | |
virtual void | addChild (MLint64, const char *) VOID_IMPLEMENTATION("addChild(MLint64)") |
Factory method adding a child encapsulating a variable of type MLint64. | |
virtual void | addChild (float val, const char *name) ADD_LDOUBLE_CHILD |
Factory method adding a child encapsulating a variable of type float. | |
virtual void | addChild (double val, const char *name) ADD_LDOUBLE_CHILD |
Factory method adding a child encapsulating a variable of type double. | |
virtual void | addChild (long double, const char *) VOID_IMPLEMENTATION("addChild(long double)") |
Factory method adding a child encapsulating a variable of type long double. | |
The class TreeNode is the abstract base class for the import/export of ML objects.
It provides an interface that allows the import/export of standard C types such as int or float, as well as standard ML types like Vector6 or SubImageBox, and last but definitely not least, of complex user defined objects. Polymorphy is supported by allowing the I/E of base objects which can created automatically using the runtime system, and can be initialized using the Base::readStateFromTree method.
Definition at line 154 of file mlTreeNode.h.
TreeNode construction modes:
Enumerator | |
---|---|
CM_writerRoot | Construct as root node for writing. |
CM_readerRoot | Construct as root node for reading. |
CM_COUNT | number of construction modes |
Definition at line 197 of file mlTreeNode.h.
|
virtual |
Destructor deleting all children of this node.
Factory method adding a child encapsulating a variable of type bool.
Referenced by ml::ListTemplate< T >::addStateToTree(), and ml::BaseListTemplate< T >::addStateToTree().
Factory method adding a child encapsulating a variable of type char.
Factory method adding a child encapsulating a variable of type double.
Factory method adding a child encapsulating a variable of type float.
Factory method adding a child encapsulating a variable of type int.
Factory method adding a child encapsulating a variable of type long double.
Reimplemented in ml::XMLTreeNode.
Factory method adding a child encapsulating a variable of type long.
Reimplemented in ml::XMLTreeNode.
Factory method adding a child encapsulating a variable of type MLint64.
Reimplemented in ml::XMLTreeNode.
Factory method adding a child encapsulating a variable of type MLuint64.
Reimplemented in ml::XMLTreeNode.
Factory method adding a child encapsulating a variable of type short.
Factory method adding a child encapsulating a variable of type unsigned char.
Factory method adding a child encapsulating a variable of type unsigned int.
Factory method adding a child encapsulating a variable of type long.
Reimplemented in ml::XMLTreeNode.
Factory method adding a child encapsulating a variable of type unsigned short.
Reads the subtree represented by this node from a file.
Reimplemented in ml::XMLTreeNode.
Reads the subtree represented by this node from a string.
This method can be used to quickly implement setPersistentString() for a class with TreeNode support. It might not make sense in all cases, for example when the derived class performs a binary import/export of the data.
Reimplemented in ml::XMLTreeNode.
Writes the subtree represented by this node to a file.
Reimplemented in ml::XMLTreeNode.
Generates a string representation of the subtree represented by this node to a file.
This method can be used to quickly implement getPersistentString() for a class with TreeNode support. It might not make sense in all cases, for example when the derived class performs a binary import/export of the data.
Reimplemented in ml::XMLTreeNode.