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 More...
 
virtual bool hasChildren (const ModelIndex &parent)
 Or rather mightHaveChildren. More...
 
virtual unsigned int getChildCount (const ModelIndex &parent)=0
 Get number of children of the given item, an invalid index means number of top-level items. More...
 
virtual ModelIndex getChild (const ModelIndex &parent, unsigned int index)=0
 Get n-th child of an item (or n-th top-level item if parent index is invalid). More...
 
virtual ModelIndex getParent (const ModelIndex &child)=0
 Get parent of an item. More...
 
virtual int getAttributeCount () const =0
 attribute discovery More...
 
virtual std::string getAttributeName (int index) const =0
 Get name of n-th attribute. Must be overridden. More...
 
virtual Variant getAttributeDefault (int index) const
 Return default value of n-th attribute. More...
 
virtual int getAttributeIndex (const std::string &name)
 Get index of attribute with the given name. More...
 
virtual Variant getData (const ModelIndex &item, int attributeIndex)=0
 data access More...
 
virtual bool setData (const ModelIndex &item, int attributeIndex, const Variant &data, void *skipListener=nullptr)
 Update a single attribute on a single item. More...
 
virtual bool bulkSetData (const std::vector< ModelIndex > &items, int attributeIndex, const Variant &data, void *skipListener=nullptr)
 bulkSetData will be used by views to set selection state to an attribute, so that we only get a single update notification, this is important for remote handling. More...
 
virtual bool bulkSetData (const std::vector< ModelIndex > &items, int attributeIndex, const std::vector< Variant > &data, void *skipListener=nullptr)
 This method can be used to update whole columns with varying data. More...
 
- Public Member Functions inherited from ml::RefCountedBase
 RefCountedBase ()
 Constructor. More...
 
 RefCountedBase (const RefCountedBase &)
 Explicit copy constructor. More...
 
virtual void incRefCount () const
 Increase reference count. More...
 
virtual void decRefCount () const
 Decrease ref count (object will be deleted if ref count is decremented to 0) More...
 
bool isRefCountedBase () const override
 Returns if the instance is derived from RefCountedBase. More...
 
- Public Member Functions inherited from ml::EventSource
 EventSource ()
 
 EventSource (const EventSource &evSource)
 
 ~EventSource () override
 
void addEventListener (BaseEventCallback *cb, void *userData)
 add event listener callback to this Base object - the userData will be the first argument when the callback is called More...
 
void removeEventListener (BaseEventCallback *cb, void *userData)
 remove event listener callback from this Base object - arguments must be the same as for the addEventListener call More...
 
bool hasEventListeners () const
 check if any event listeners have been added to this Base object; this can be used to skip the sendEvent call (and the potentially expensive building of the event object) altogether More...
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
virtual BasedeepCopy () const
 Set addStateToTree version number that can be accessed via getAddStateVersion() More...
 
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. More...
 
virtual std::string detailString () const
 Return a string describing this object. More...
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class. More...
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state. More...
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState(). More...
 
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node. More...
 
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node. More...
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object. More...
 

Protected Member Functions

ModelIndex convertToSource (const ModelIndex &index)
 
ModelIndex convertFromSource (const ModelIndex &index)
 
void incItemRefCount (void *p) override
 propagate to source model: More...
 
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
 This will be called by setData and bulkSetData, which will do the necessary notifications afterwards; attributeIndex doesn't need to be checked for valid range, this has already been done when this method is called. More...
 
ModelIndex createIndex (void *data)
 
ModelIndex createIndex (size_t data)
 
virtual void notifyItemChanged (const ModelIndex &item, bool after, void *skipListener=nullptr)
 change notifications More...
 
virtual void notifyItemsInserted (const ModelIndex &parent, unsigned int childIndex, unsigned int itemsInserted, bool after, void *skipListener=nullptr)
 Notify listeners that an item gets/got additional children. More...
 
virtual void notifyItemsRemoved (const ModelIndex &parent, unsigned int childIndex, unsigned int itemsRemoved, bool after, void *skipListener=nullptr)
 Notify listeners that an item loses/lost additional children. More...
 
virtual void notifyItemsDataChanged (const std::vector< ModelIndex > &items, const std::vector< int > &attributeIndices, void *skipListener=nullptr)
 Notify listeners that attributes have changed on the given items. More...
 
- Protected Member Functions inherited from ml::RefCountedBase
 ~RefCountedBase () override
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More...
 
- Protected Member Functions inherited from ml::EventSource
void sendEvent (BaseEvent *event, void *skipListener=nullptr)
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More...
 
- Protected Member Functions inherited from ml::Base
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state. More...
 
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState(). More...
 
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState(). More...
 

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)
 Helper method that handles inc/dec of ref count if base instances support it. More...
 
- Protected Attributes inherited from ml::RefCountedBase
MLint32 _refCount
 Reference count. More...
 

Detailed Description

Definition at line 25 of file mlItemModelProxy.h.

Constructor & Destructor Documentation

◆ ItemModelProxy()

ml::ItemModelProxy::ItemModelProxy ( AbstractItemModelPtr  sourceModel)

◆ ~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.

◆ incItemRefCount()

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

propagate to source model:

Reimplemented from ml::AbstractItemModel.

◆ sourceModel()

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

Definition at line 31 of file mlItemModelProxy.h.


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