VSTGUI  4.4
Graphical User Interface Framework not only for VST plugins
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
IDependency Class Reference

simple dependency between objects. More...

+ Inheritance diagram for IDependency:

Classes

class  DeferChanges
 helper class to defer changes until instance is destroyed. More...
 

Public Member Functions

virtual void addDependency (CBaseObject *obj)
 add a dependent object More...
 
virtual void removeDependency (CBaseObject *obj)
 remove a dependent object. More...
 
virtual void changed (IdStringPtr message)
 notify dependent objects of change with message. More...
 
virtual void deferChanges (bool state)
 defer changes until later. More...
 

Protected Types

typedef std::set< IdStringPtrDeferedChangesSet
 
typedef std::list< CBaseObject * > DependentList
 

Protected Member Functions

 IDependency ()
 
virtual ~IDependency ()
 

Static Protected Member Functions

static void rememberObject (CBaseObject *obj)
 
static void forgetObject (CBaseObject *obj)
 

Protected Attributes

int32_t deferChangeCount
 
DeferedChangesSet deferedChanges
 
DependentList dependents
 

Detailed Description

simple dependency between objects.

You can inject this implementation into CBaseObjects whenever you need other CBaseObjects to be informed about changes to that class instance. Note that you need to handle recursions yourself and that no reference counting is done and that you must make sure that the dependent objects are alife while added as dependent.

Member Typedef Documentation

typedef std::set<IdStringPtr> DeferedChangesSet
protected
typedef std::list<CBaseObject*> DependentList
protected

Constructor & Destructor Documentation

IDependency ( )
inlineprotected
~IDependency ( )
inlineprotectedvirtual

Member Function Documentation

void addDependency ( CBaseObject obj)
inlinevirtual

add a dependent object

void changed ( IdStringPtr  message)
inlinevirtual

notify dependent objects of change with message.

void deferChanges ( bool  state)
inlinevirtual

defer changes until later.

can be nested. If you use this, you must make sure that all message pointers are valid the whole time.

static void forgetObject ( CBaseObject obj)
inlinestaticprotected
static void rememberObject ( CBaseObject obj)
inlinestaticprotected
void removeDependency ( CBaseObject obj)
inlinevirtual

remove a dependent object.

Member Data Documentation

int32_t deferChangeCount
protected
DeferedChangesSet deferedChanges
protected
DependentList dependents
protected

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