|
ML Reference
|
#include <mlBase.h>
Public Member Functions | |
| Base () | |
| Constructor. | |
| virtual | ~Base () |
| Destructor. | |
| virtual Base * | deepCopy () const |
| bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
| virtual bool | isRefCountedBase () const |
| Returns whether the instance is derived from RefCountedBase. | |
| virtual std::string | detailString () const |
Persistence interfaces | |
| enum | PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream } |
| This enum describes the different persistence interfaces available. More... | |
| virtual bool | implementsPersistence (PersistenceInterface) const |
| virtual std::string | persistentState () const |
| Returns a string describing the object's internal state. | |
| virtual void | setPersistentState (const std::string &state) |
| virtual void | addStateToTree (TreeNode *) const |
| Attaches the object state as children of the given parent node. | |
| virtual void | readStateFromTree (TreeNode *) |
| Reads the object state from the children of the given parent node. | |
| virtual void | writeTo (AbstractPersistenceOutputStream *) const |
| virtual void | readFrom (AbstractPersistenceInputStream *, int) |
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
BaseField)Remark: This class is base class for Module and all derived modules.
| ml::Base::Base | ( | ) |
Constructor.
Referenced by ml::FieldContainer::addBase(), and deepCopy().
|
virtual |
Destructor.
|
inlinevirtual |
|
inlinevirtual |
Creates a deep copy of the given object. The default implementation returns a NULL pointer and has to be overridden 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.
References Base(), and deepCopy().
Referenced by deepCopy().
|
inlinevirtual |
|
inlinevirtual |
| bool ml::Base::isOfAllowedType | ( | const std::vector< const RuntimeType * > & | types | ) | const |
Checks whether 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.
|
inlinevirtual |
Returns whether the instance is derived from RefCountedBase.
Reimplemented in ml::RefCountedBase.
|
virtual |
Returns a string describing the object's internal state.
|
inlinevirtual |
Reads the objects state from the data stream object. version is the version number given by 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 subclassing from another Base class that implements persistence, use the macro ML_READFROM_SUPER() to load the superclass data, because this takes care of reading and checking the version number of the superclass.
|
inlinevirtual |
|
virtual |
Restores the object's internal state from a string that had been previously generated using persistentState().
|
inlinevirtual |
Writes the objects state to the data stream object.
Include mlAbstractPersistenceStream.h for the implementation of this method.
If you are subclassing from another Base class that implements persistence, use the macro ML_WRITETO_SUPER() to save the superclass data, because this takes care of writing the version number of the superclass.