5#include "base/src/basei.h"
6#include "shared/interface/signal.h"
27 using signal_type = shared::Signal<const IThing *,const IContainer *>;
160 bool atEnd()
const {
if (!c_ || !i_)
return true;
return c_->
atEnd(i_); }
173 const T *
get()
const {
if (!c_ || !i_)
return 0;
return convert_cast<T>(c_->
get(i_)); }
179 operator const T *()
const {
return get(); }
213 operator T *()
const {
return get(); }
Const iterator for an IContainer.
Definition icontainer.h:148
const T * get() const
Return a const pointer to T.
Definition icontainer.h:173
bool atEnd() const
Returns true if at the end of the IContainer.
Definition icontainer.h:160
void copy(const ICIterator< T > &c)
Copy another iterator.
Definition icontainer.h:181
const T * operator->() const
Return a const pointer to T.
Definition icontainer.h:175
const ICIterator< T > & operator++()
Increment the const iterator to the next entry in the IContainer.
Definition icontainer.h:162
~ICIterator()
Destructor for the const iterator.
Definition icontainer.h:154
void setContainer(const IContainer *c)
Associate this with a different container.
Definition icontainer.h:156
const IContainer * getContainer() const
Get the IContainer pointer that this iterator is associated with.
Definition icontainer.h:158
const T & operator*() const
Return a const reference to T.
Definition icontainer.h:177
ICIterator(const IContainer *c)
Definition icontainer.h:152
Interface class for iterating through the container that has a null implementation.
Definition icontainer.h:33
Interface for containers of IThings.
Definition icontainer.h:21
virtual IThing * remove(IThing *t)=0
virtual uint64 getSize() const =0
Returns the IThing count or number of IThings held in the container.
virtual bool copy(IOpaqueIterator *iSrc, IOpaqueIterator *iDst) const =0
virtual const signal_type * getAddedSignal() const =0
virtual const IContainer * getIContainer() const =0
Returns the const IThing pointer of the container.
virtual IOpaqueIterator * acquire() const =0
Acquire a new IOpaqueIterator for use iterating through the container.
virtual bool atEnd(IOpaqueIterator *i) const =0
virtual bool isPartitioned() const =0
Returns TRUE if the container is partitioned in cluster mode (zones, balls, etc).
virtual void release(IOpaqueIterator *i) const =0
virtual const IThing * getIThing() const =0
Returns the const IThing pointer of the container.
virtual const IThing * findWithID(uint64 id) const =0
virtual IThing * doSilentRemove(IThing *t)=0
virtual IThing * get(IOpaqueIterator *i)=0
virtual const IThing * get(IOpaqueIterator *i) 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 hoo...
virtual IThing * findWithID(uint64 id)=0
virtual IThing * getIThing()=0
Returns the IThing pointer of the container.
shared::Signal< const IThing *, const IContainer * > signal_type
Defines the Signal2<> type used for removed, added, and destroy signals sent from the container.
Definition icontainer.h:27
virtual const IThing * findWithName(const IString &s) const =0
virtual const signal_type * getDestroySignal() const =0
virtual bool getValueBased() const =0
Returns TRUE if the container is value based, or pointer based.
static const TType type_
The type identification number for this class, for use in convert_cast() and convert_getcast().
Definition icontainer.h:24
virtual uint64 getInstance(uint64 id) const =0
Return instance count associated with id, this is always 0 if not a value based container.
virtual void erase(IThing *t)=0
virtual bool increment(IOpaqueIterator *i) const =0
virtual IThing * add(IThing *t, uint64 id=0)=0
virtual const signal_type * getRemovedSignal() const =0
virtual uint64 getNumberHidden() const =0
Returns the number of IThings that have getHidden()==true.
virtual IContainer * getIContainer()=0
Returns the IThing pointer of the container.
virtual uint64 getNextID() const =0
virtual IThing * findWithName(const IString &s)=0
virtual uint64 getNumberSelected() const =0
Returns the number of IThings that have getSelected()==true.
Iterator for an IContainer.
Definition icontainer.h:197
IIterator(IContainer *c)
Definition icontainer.h:201
T & operator*() const
Return a referenc to T.
Definition icontainer.h:211
const IIterator< T > & operator++()
Increment the iterator to the next entry in the IContainer.
Definition icontainer.h:203
T * get() const
Return a pointer to T.
Definition icontainer.h:207
void setContainer(IContainer *c)
Associate this with a different container.
Definition icontainer.h:205
T * operator->() const
Return a pointer to T.
Definition icontainer.h:209
Base class for items that will be stored in containers.
Definition ithing.h:30
uint32 TType
class type indicator
Definition basedef.h:46
Base class for items that will be stored in containers.
namespace Itasca
Definition basememory.cpp:14
namespace itasca
Definition igenerictet.h:11