26#include <ThirdPartyWarningsDisable.h>
29#include <ThirdPartyWarningsRestore.h>
32#define ML_SET_ADDSTATE_VERSION(v) static int getAddStateVersion(void) { return v; };
34#define ML_PERSISTENCE_VERSION(v) ML_SET_ADDSTATE_VERSION(v)
36ML_UTILS_START_NAMESPACE
40class AbstractPersistenceOutputStream;
41class AbstractPersistenceInputStream;
144ML_UTILS_END_NAMESPACE
146#undef ML_BASE_VERSION
175template<
typename ToTypePtr>
178 if (from->getTypeId()->isDerivedFrom((
static_cast<ToTypePtr
>(0))->getClassTypeId())) {
179 return static_cast<ToTypePtr
>(from);
189template<
typename ToTypePtr>
190inline ToTypePtr
mlbase_cast(
const ML_UTILS_NAMESPACE::Base* from) {
192 if (from->getTypeId()->isDerivedFrom((
static_cast<ToTypePtr
>(0))->getClassTypeId())) {
193 return static_cast<ToTypePtr
>(from);
virtual void setPersistentState(const std::string &state)
virtual std::string detailString() const
virtual bool implementsPersistence(PersistenceInterface) const
virtual std::string persistentState() const
Returns a string describing the object's internal state.
virtual void addStateToTree(TreeNode *) const
Attaches the object state as children of the given parent node.
virtual Base * deepCopy() const
virtual ~Base()
Destructor.
virtual void readFrom(AbstractPersistenceInputStream *, int)
virtual bool isRefCountedBase() const
Returns whether the instance is derived from RefCountedBase.
virtual void writeTo(AbstractPersistenceOutputStream *) const
bool isOfAllowedType(const std::vector< const RuntimeType * > &types) const
PersistenceInterface
This enum describes the different persistence interfaces available.
virtual void readStateFromTree(TreeNode *)
Reads the object state from the children of the given parent node.
ToTypePtr mlbase_cast(ml::Base *from)
Template function to allow type-safe casting of a base object to a derived object.
#define ML_PERSISTENCE_VERSION(v)
Nicer name for ML_SET_ADDSTATE_VERSION.
#define ML_ABSTRACT_ROOT_CLASS_HEADER(className)