Class representing general ML objects that support import/export via strings (setPersistentState() and getPersistentState()), arbitrary tree structures (using addStateToTree() and readStateFromTree()) or a data stream (using writeTo() and readFrom()).
More...
#include <mlBase.h>
|
| Base () |
| Constructor.
|
|
virtual | ~Base () |
| Destructor.
|
|
virtual Base * | deepCopy () const |
| Set addStateToTree version number that can be accessed via getAddStateVersion()
|
|
bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
| Check if this object's type is equal to or derived from one of the types given in the argument.
|
|
virtual bool | isRefCountedBase () const |
| Returns if the instance is derived from RefCountedBase.
|
|
virtual std::string | detailString () const |
| Return a string describing this object.
|
|
Class representing general ML objects that support import/export via strings (setPersistentState() and getPersistentState()), arbitrary tree structures (using addStateToTree() and readStateFromTree()) or a data stream (using writeTo() and readFrom()).
Objects of class Base
- can be represented using the field concept (class
BaseField
)
- provide an interface to allow the import/export of a persistent representation of an object's internal state.
Remark: This class is base class for Module
and all derived modules.
Definition at line 58 of file mlBase.h.
◆ PersistenceInterface
This enum describes the different persistence interfaces available.
can be implemented in derived classes:
Enumerator |
---|
PersistenceByString | |
PersistenceByTreeNode | |
PersistenceByStream | |
Definition at line 73 of file mlBase.h.
◆ Base()
◆ ~Base()
virtual ml::Base::~Base |
( |
| ) |
|
|
virtual |
◆ addStateToTree()
virtual void ml::Base::addStateToTree |
( |
TreeNode * | | ) |
const |
|
inlinevirtual |
Attaches the object state as children of the given parent node.
Definition at line 91 of file mlBase.h.
◆ deepCopy()
virtual Base * ml::Base::deepCopy |
( |
| ) |
const |
|
inlinevirtual |
Set addStateToTree version number that can be accessed via getAddStateVersion()
Creates a deep copy of the given object. The default implementation returns a NULL pointer and has to be overloaded by derived classes. It can be used to clone Base objects without knowledge of the exact type of object.
Definition at line 124 of file mlBase.h.
◆ detailString()
virtual std::string ml::Base::detailString |
( |
| ) |
const |
|
inlinevirtual |
Return a string describing this object.
This is mainly meant to return the sub-type of wrapped objects, which are not reflected in the Base type system.
Definition at line 136 of file mlBase.h.
◆ implementsPersistence()
Override this method to declare which persistence interfaces are implemented by your derived class.
Definition at line 81 of file mlBase.h.
◆ isOfAllowedType()
bool ml::Base::isOfAllowedType |
( |
const std::vector< const RuntimeType * > & | types | ) |
const |
Check if this object's type is equal to or derived from one of the types given in the argument.
This method will also return true if the vector is empty, since this denotes that any type is allowed.
◆ isRefCountedBase()
virtual bool ml::Base::isRefCountedBase |
( |
| ) |
const |
|
inlinevirtual |
◆ persistentState()
virtual std::string ml::Base::persistentState |
( |
| ) |
const |
|
virtual |
Returns a string describing the object's internal state.
◆ readFrom()
Read the objects state from the data stream object.
version is the version number given through ML_PERSISTENCE_VERSION at the time the object was written to the AbstractPersistenceOutStream.
Include mlAbstractPersistenceStream.h for the implementation of this method.
If you are sub-classing from another Base class that implements persistence, use the macro ML_READFROM_SUPER() to load the super-class data, because this takes care of reading and checking the version number of the super class.
Definition at line 114 of file mlBase.h.
◆ readStateFromTree()
virtual void ml::Base::readStateFromTree |
( |
TreeNode * | | ) |
|
|
inlinevirtual |
Reads the object state from the children of the given parent node.
Definition at line 94 of file mlBase.h.
◆ setPersistentState()
virtual void ml::Base::setPersistentState |
( |
const std::string & | state | ) |
|
|
virtual |
Restores the object's internal state from a string that had been previously generated using persistentState()
.
◆ writeTo()
Write the objects state to the data stream object.
Include mlAbstractPersistenceStream.h for the implementation of this method.
If you are sub-classing from another Base class that implements persistence, use the macro ML_WRITETO_SUPER() to save the super-class data, because this takes care of writing the version number of the super class.
Definition at line 103 of file mlBase.h.
The documentation for this class was generated from the following file:
- MeVis/Foundation/Sources/MLUtilities/mlBase.h