Itasca C++ Interface
|
Interface for containers of IThings. More...
#include <icontainer.h>
Classes | |
class | IOpaqueIterator |
Interface class for iterating through the container that has a null implementation. More... | |
Public Types | |
using | signal_type = shared::Signal<const IThing *,const IContainer *> |
Defines the Signal2<> type used for removed, added, and destroy signals sent from the container. | |
Public Member Functions | |
virtual IThing * | getIThing ()=0 |
Returns the IThing pointer of the container. | |
virtual const IThing * | getIThing () const =0 |
Returns the const IThing pointer of the container. | |
virtual IContainer * | getIContainer ()=0 |
Returns the IThing pointer of the container. | |
virtual const IContainer * | getIContainer () const =0 |
Returns the const IThing pointer of the container. | |
virtual bool | getValueBased () const =0 |
Returns TRUE if the container is value based, or pointer based. | |
virtual bool | isPartitioned () const =0 |
Returns TRUE if the container is partitioned in cluster mode (zones, balls, etc). | |
virtual uint64 | getSize () const =0 |
Returns the IThing count or number of IThings held in the container. | |
virtual uint64 | getNumberHidden () const =0 |
Returns the number of IThings that have getHidden()==true. | |
virtual uint64 | getNumberSelected () const =0 |
Returns the number of IThings that have getSelected()==true. | |
virtual uint64 | getNextID () const =0 |
virtual void | setNextID (uint64)=0 |
Set the maximum ID. This should only be used on a restore if manipulating the container under the hood. | |
virtual IThing * | remove (IThing *t)=0 |
virtual void | erase (IThing *t)=0 |
virtual IThing * | add (IThing *t, uint64 id=0)=0 |
virtual void | clear ()=0 |
virtual IThing * | findWithID (uint64 id)=0 |
virtual const IThing * | findWithID (uint64 id) const =0 |
virtual uint64 | getInstance (uint64 id) const =0 |
Return instance count associated with id, this is always 0 if not a value based container. | |
virtual IThing * | findWithName (const IString &s)=0 |
virtual const IThing * | findWithName (const IString &s) const =0 |
virtual const signal_type * | getAddedSignal () const =0 |
virtual const signal_type * | getRemovedSignal () const =0 |
virtual const signal_type * | getDestroySignal () const =0 |
virtual IOpaqueIterator * | acquire () const =0 |
Acquire a new IOpaqueIterator for use iterating through the container. | |
virtual void | release (IOpaqueIterator *i) const =0 |
virtual bool | atEnd (IOpaqueIterator *i) const =0 |
virtual IThing * | get (IOpaqueIterator *i)=0 |
virtual const IThing * | get (IOpaqueIterator *i) const =0 |
virtual bool | increment (IOpaqueIterator *i) const =0 |
virtual bool | copy (IOpaqueIterator *iSrc, IOpaqueIterator *iDst) const =0 |
virtual IThing * | doSilentRemove (IThing *t)=0 |
Public Attributes | |
signal_type | thingAdded |
signal_type | thingRemoved |
signal_type | aboutToDestroy |
Static Public Attributes | |
static const TType | type_ = 0x51cdf4ed |
The type identification number for this class, for use in convert_cast() and convert_getcast(). | |
Interface for containers of IThings.
A container, derived from IThing, contains a set of IThings. This interface provides methods to add, remove and erase an IThing. In addition, one can search for IThings via their names (as defined by the implementation) or unique integer IDs. A container holds a small granularity callback utility so that other methods can be invoked whenever an IThing is added, removed or erased.
Add the IThing t to the container. A pointer to t is returned. Any method or Signal2 attached to the Signal2 returned by getAddedSignal() will be executed when add() is invoked.
t | Pointer to an IThing that will be added to the container. If the container is value based, a copy of t is placed in the container, and the return value is not the same as the argument. |
|
pure virtual |
Return true if at the end of the container, false otherwise.
i | Pointer to IOpaqueIterator. |
|
pure virtual |
Delete each IThing held in the container. Note that remove() is not invoked. Will execute getRemovedSignal() with a null pointer if there is anything in the container.
|
pure virtual |
Copy the IOpaqueIterator iSrc to iDst. Returns true if this is successful.
iSrc | Pointer to IOpaqueIterator that is the source to be copied. |
iDst | Pointer to IOpaqueIterator that is the destination of the copy. |
Silently remove t. This means that no events are called. DO NOT USE THIS UNLESS YOU KNOW THAT IT IS NECESSARY!!
|
pure virtual |
Erase the IThing t from the container. This invokes the remove() function and subsequently deletes t. Any method or Signal2 attached to the Signal2 returned by getRemovedSignal() will be executed when erase() is invoked.
t | Pointer to an IThing that will be erased from the container. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Return a const pointer to the IThing the iterator i refers to.
i | Pointer to IOpaqueIterator. |
|
pure virtual |
Return a pointer to the IThing the iterator i refers to.
i | Pointer to IOpaqueIterator. |
|
pure virtual |
Returns the small granularity callback Signal2 object (templatized with IThing * and IContainer * arguments) held in the container to which methods or Signal2 objects are attached that will be executed whenever an IThing is added to the container via the add() function. If the first argument (const IThing *) is null, that indicates that the list has just been restored and that ALL elements of the list have effectively been added.
|
pure virtual |
Returns the small granularity callback Signal2 object (templatized with IContainer arguments) held in the container to which methods or Signal2 objects are attached that will be executed just before the container itself is destroyed, allowing objects that depend on it (and hold iterators to it) to clear themselves.
|
pure virtual |
|
pure virtual |
Returns the small granularity callback Signal2 object (templatized with IThing * and IContainer * arguments) held in the container to which methods or Signal2 objects are attached that will be executed whenever an IThing is removed or erased from the container via the remove() or erase() functions. If the first argument (const IThing *) is null, that indicates that the list is about to be cleared of ALL elements.
|
pure virtual |
Increments the iterator if possible. Returns true if the iterator is incremented (e.g., if there is a next IThing in the container) else false.
i | Pointer to IOpaqueIterator. |
|
pure virtual |
Release a previously acquired IOpaqueIterator.
i | Pointer to IOpaqueIterator. |
Remove the IThing t from the container. A pointer to t is returned. Any method or Signal2 attached to the Signal2 returned by getRemovedSignal() will be executed when remove() is invoked.
t | Pointer to an IThing that will be removed from the container. This function is not allowed on a value based container, and will automatically trigger an exception. |