MeVisLab Toolbox Reference
ml::ItemModelProxy Class Reference

#include <mlItemModelProxy.h>

Inheritance diagram for ml::ItemModelProxy:
ml::AbstractItemModel ml::RefCountedBase ml::EventSource ml::Base ml::ItemModelAttributeFilter ml::ItemModelItemFilter

Public Member Functions

 ItemModelProxy (AbstractItemModelPtr sourceModel)
 ~ItemModelProxy () override
AbstractItemModelPtr sourceModel () const
Public Member Functions inherited from ml::AbstractItemModel
virtual bool isFlat () const
 item traversal interface
virtual bool hasChildren (const ModelIndex &parent)
virtual unsigned int getChildCount (const ModelIndex &parent)=0
virtual ModelIndex getChild (const ModelIndex &parent, unsigned int index)=0
virtual ModelIndex getParent (const ModelIndex &child)=0
virtual int getAttributeCount () const =0
 Attribute discovery.
virtual std::string getAttributeName (int index) const =0
 Returns the name of n-th attribute. Must be overridden.
virtual Variant getAttributeDefault (int index) const
virtual int getAttributeIndex (const std::string &name)
virtual Variant getData (const ModelIndex &item, int attributeIndex)=0
 Data access.
virtual bool setData (const ModelIndex &item, int attributeIndex, const Variant &data, void *skipListener=nullptr)
virtual bool bulkSetData (const std::vector< ModelIndex > &items, int attributeIndex, const Variant &data, void *skipListener=nullptr)
virtual bool bulkSetData (const std::vector< ModelIndex > &items, int attributeIndex, const std::vector< Variant > &data, void *skipListener=nullptr)
Public Member Functions inherited from ml::RefCountedBase
 RefCountedBase ()
 Constructor.
 RefCountedBase (const RefCountedBase &)
 Explicit copy constructor.
virtual void incRefCount () const
 Increases the reference count.
virtual void decRefCount () const
 Decreases the reference count (object will be deleted if the reference count is decremented to 0).
bool isRefCountedBase () const override
 Returns whether the instance is derived from RefCountedBase.
Public Member Functions inherited from ml::EventSource
 EventSource ()
 EventSource (const EventSource &evSource)
 ~EventSource () override
void addEventListener (BaseEventCallback *cb, void *userData)
void removeEventListener (BaseEventCallback *cb, void *userData)
bool hasEventListeners () const
Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
virtual ~Base ()
 Destructor.
virtual BasedeepCopy () const
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
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 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)

Protected Member Functions

ModelIndex convertToSource (const ModelIndex &index)
ModelIndex convertFromSource (const ModelIndex &index)
void incItemRefCount (void *p) override
 Propagate to source model.
void decItemRefCount (void *p) override
Protected Member Functions inherited from ml::AbstractItemModel
 AbstractItemModel ()
virtual bool rawSetData (const ModelIndex &item, int attributeIndex, const Variant &data)=0
ModelIndex createIndex (void *data)
ModelIndex createIndex (size_t data)
virtual void notifyItemChanged (const ModelIndex &item, bool after, void *skipListener=nullptr)
 change notifications
virtual void notifyItemsInserted (const ModelIndex &parent, unsigned int childIndex, unsigned int itemsInserted, bool after, void *skipListener=nullptr)
virtual void notifyItemsRemoved (const ModelIndex &parent, unsigned int childIndex, unsigned int itemsRemoved, bool after, void *skipListener=nullptr)
virtual void notifyItemsDataChanged (const std::vector< ModelIndex > &items, const std::vector< int > &attributeIndices, void *skipListener=nullptr)
Protected Member Functions inherited from ml::RefCountedBase
 ~RefCountedBase () override
 Destructor.
Protected Member Functions inherited from ml::EventSource
void sendEvent (BaseEvent *event, void *skipListener=nullptr)

Additional Inherited Members

Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
Static Public Member Functions inherited from ml::RefCountedBase
static void updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase)
Protected Attributes inherited from ml::RefCountedBase
std::atomic_int_least32_t _refCount
 Reference count.

Detailed Description

Definition at line 25 of file mlItemModelProxy.h.

Constructor & Destructor Documentation

◆ ItemModelProxy()

ml::ItemModelProxy::ItemModelProxy ( AbstractItemModelPtr sourceModel)

References sourceModel().

Referenced by decItemRefCount().

◆ ~ItemModelProxy()

ml::ItemModelProxy::~ItemModelProxy ( )
override

Member Function Documentation

◆ convertFromSource()

ModelIndex ml::ItemModelProxy::convertFromSource ( const ModelIndex & index)
protected

◆ convertToSource()

ModelIndex ml::ItemModelProxy::convertToSource ( const ModelIndex & index)
protected

◆ decItemRefCount()

void ml::ItemModelProxy::decItemRefCount ( void * p)
overrideprotectedvirtual

Reimplemented from ml::AbstractItemModel.

References ItemModelProxy().

◆ incItemRefCount()

void ml::ItemModelProxy::incItemRefCount ( void * p)
overrideprotectedvirtual

Propagate to source model.

Reimplemented from ml::AbstractItemModel.

◆ sourceModel()

AbstractItemModelPtr ml::ItemModelProxy::sourceModel ( ) const
inline

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