MeVisLab Toolbox Reference
ml::BaseList Class Reference

Base object class BaseList which stores a list of BaseContainerItem entries. More...

#include <mlBaseList.h>

Inheritance diagram for ml::BaseList:
ml::BaseListTemplate< BaseContainerItem > ml::ListTemplate< BaseContainerItem > ml::ListBase ml::Base

Public Member Functions

 BaseList ()
 Constructor, enables persistence.
 BaseList (const BaseList &other)
BaseListdeepCopy () const override
 Create a deep copy of the list.
Public Member Functions inherited from ml::BaseListTemplate< BaseContainerItem >
BaseListTemplate< BaseContainerItem > & operator= (const BaseListTemplate &other)=default
 explicitly create default assignment operator
BaseItemgetItemAt (MLssize_t index) override
const BaseItemgetConstItemAt (MLssize_t index) const override
 Same as getItemAt(MLssize_t index) for constant access.
void insertItemAt (MLssize_t index, const BaseItem *item) override
void modifyItemAt (MLssize_t index, const BaseItem *item) override
void deleteItemAt (MLssize_t index) override
void selectItemAt (MLssize_t index) override
const RuntimeTypegetItemTypeId () const override
void clearList () override
 Clear complete list.
 BaseListTemplate ()
 Standard constructor, disables persistence.
virtual MLssize_t newId ()
 Get new unused id.
virtual void usedId (MLssize_t id)
 Notify list that id is used.
virtual void resetId ()
 Reset next id.
virtual void doDeleteItem (MLssize_t index)
 Delete single item at position index and set the corresponding ActDelete action.
virtual void doInsertItem (MLssize_t index, const BaseContainerItem &item)
virtual void doModifyItem (MLssize_t index, const BaseContainerItem &item)
virtual void doSelectItem (MLssize_t index)
virtual void appendItem (const BaseContainerItem &item)
void addStateToTree (TreeNode *parent) const override
 Attaches the object state as children of the given parent node.
 ML_SET_ADDSTATE_VERSION (1)
 Set addState version number.
void readStateFromTree (TreeNode *parent) override
 Reads the object state from the children of the given parent node.
Public Member Functions inherited from ml::ListTemplate< BaseContainerItem >
 ListTemplate ()
 Standard constructor, disables persistence.
size_t getSize () const override
 Get number of list elements.
void clearList () override
 Clear complete list.
ListTemplate< BaseContainerItem > & operator= (const ListTemplate< BaseContainerItem > &list)
 Assignment operator.
ListTemplate< BaseContainerItem > * clone () const override
ListTemplate< BaseContainerItem > * deepCopy () const override
 Create a deep copy of the list.
std::string persistentState () const override
void setPersistentState (const std::string &state) override
 Initialize the list object from the string state.
void addStateToTree (TreeNode *parent) const override
 Attaches the state as children of the given parent node.
 ML_SET_ADDSTATE_VERSION (2)
 Set addState version number, version 2 indicates data saved by a 64 bit version.
void readStateFromTree (TreeNode *parent) override
 Reads the object state from the children of the given parent node.
Public Member Functions inherited from ml::ListBase
 ListBase (bool persistence)
 Constructor. Derived class should indicate whether persistence is implemented.
 ListBase (const ListBase &other)
void setContainer (ListContainerBase *container)
ListContainerBasegetContainer () const
virtual void setAction (ActionClass actionClass, MLssize_t id, MLssize_t index)
 Set actionClass, affected item id and index.
virtual void setAction (ActionClass actionClass)
 Set actionClass for actions affecting the whole list.
virtual void getAction (ActionClass &actionClass, MLssize_t &id, MLssize_t &index) const
 Get actionClass, affected item id and index.
virtual ActionClass getActionClass () const
 Get actionClass of last action.
virtual MLssize_t getActionId () const
 Get id of item affected by last action.
virtual MLssize_t getActionIndex () const
virtual MLssize_t getCurrentIndex () const
 Get index of currently selected item, or -1 if no item selected.
virtual bool isModified () const
 Tests, if the last action has been an action that has modified the content of the list.
virtual bool hasPersistence () const
 Test if persistence is available and enabled.
virtual void setPersistence (bool persistence)
 Enable/disable persistence functionality.
bool hasPersistance () const
void setPersistance (bool persistence)
 ML_SET_ADDSTATE_VERSION (0)
 Set addState version number.
Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
virtual ~Base ()
 Destructor.
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
virtual bool implementsPersistence (PersistenceInterface) const
virtual void writeTo (AbstractPersistenceOutputStream *) const
virtual void readFrom (AbstractPersistenceInputStream *, int)

Additional Inherited Members

Public Types inherited from ml::ListTemplate< BaseContainerItem >
typedef BaseContainerItem itemType
Public Types inherited from ml::ListBase
enum  ActionClass {
  ActNone = 0 , ActUnknown , ActNew , ActSelect ,
  ActModify , ActDelete , ActInsert , ActInsertOvw ,
  ActNumActions
}
 Constants to describe the type of action most recently performed. More...
Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
static const char *const ActionClassNames [ActNumActions]
 Action class name constants.
std::string itemState (typename ListTemplate< BaseContainerItem >::const_iterator it) const override
void setItemState (typename ListTemplate< BaseContainerItem >::iterator it, const std::string &state) override
 Initialize the item object from the string state.
Protected Member Functions inherited from ml::ListTemplate< BaseContainerItem >
Protected Member Functions inherited from ml::ListBase
char * newString (const std::string &str) const
void deleteString (char *str) const
 Dispose a string allocated with newString().
ListBaseoperator= (const ListBase &list)
 Assignment operator, used in derived list classes.

Detailed Description

Base object class BaseList which stores a list of BaseContainerItem entries.

Definition at line 184 of file mlBaseList.h.

Constructor & Destructor Documentation

◆ BaseList() [1/2]

ml::BaseList::BaseList ( )
inline

Constructor, enables persistence.

Definition at line 190 of file mlBaseList.h.

References ml::BaseListTemplate< BaseContainerItem >::BaseListTemplate().

Referenced by BaseList(), and deepCopy().

◆ BaseList() [2/2]

ml::BaseList::BaseList ( const BaseList & other)
inline

Member Function Documentation

◆ deepCopy()

BaseList * ml::BaseList::deepCopy ( ) const
overridevirtual

Create a deep copy of the list.

Reimplemented from ml::Base.

References BaseList().


The documentation for this class was generated from the following file: