Base class for collection implementation. More...
Public Types | |
| typedef Integer | size_type |
| Type indexing the array. | |
| typedef ptrdiff_t | difference_type |
| Type of a distance between array iterator elements. | |
Public Member Functions | |
| CollectionImplBase ()=default | |
| Constructs an empty collection. | |
| CollectionImplBase (Integer acount) | |
| Constructs a collection with acount elements. | |
| CollectionImplBase (const CollectionImplBase &from)=delete | |
| Copy constructor. event handlers are not copied. | |
| Integer | count () const |
| Returns the number of elements in the collection. | |
| virtual void | clear ()=0 |
| Removes all elements from the collection. | |
| virtual void | onClear () |
| Event sent before removing all elements. | |
| virtual void | onClearComplete () |
| Event sent when all elements have been removed. | |
| virtual void | onInsert () |
| Event sent before inserting an element. | |
| virtual void | onInsertComplete (void *object, Integer position) |
| Event sent after inserting an element. | |
| virtual void | onRemove () |
| Event sent before removing an element. | |
| virtual void | onRemoveComplete (void *object, Integer position) |
| Event sent after removing an element. | |
| virtual void | onSet () |
| virtual void | onSetComplete (void *object, Integer position) |
| virtual void | onValidate () |
| virtual EnumeratorImplBase * | enumerator () const =0 |
| Returns a generic enumerator for the collection. | |
| CollectionChangeEventHandler & | change () |
| Public Member Functions inherited from Arcane::ObjectImpl | |
| ObjectImpl (const ObjectImpl &rhs)=delete | |
| ObjectImpl & | operator= (const ObjectImpl &rhs)=delete |
| void | addRef () |
| Increments the reference counter. | |
| void | removeRef () |
| Decrements the reference counter. | |
| Int32 | refCount () const |
| Returns the value of the reference counter. | |
| virtual void | deleteMe () |
| Destroys this object. | |
Protected Member Functions | |
| void | _setCount (Integer acount) |
Private Member Functions | |
| void | _sendEvent (CollectionEventArgs::eAction action, void *object, Integer position) |
Private Attributes | |
| Integer | m_count = 0 |
| CollectionChangeEventHandler | m_collection_handlers |
Base class for collection implementation.
A collection is an object containing elements (i.e., a container).
It is possible to iterate over the elements of a collection using an enumerator obtained via enumerator(). The enumerator obtained this way is generic regardless of the collection type. It is therefore less performant than an enumerator dedicated to a type, and it is better to use the latter if possible.
A collection generates events when elements are removed, inserted, or modified. It is possible to register a handler to receive these events using change().
Constant operations are threadsafe.
This class is intended to be derived for each implementation of a collection.
Definition at line 327 of file arccore/src/common/arccore/common/Collection.h.
| typedef ptrdiff_t Arcane::CollectionImplBase::difference_type |
Type of a distance between array iterator elements.
Definition at line 335 of file arccore/src/common/arccore/common/Collection.h.
Type indexing the array.
Definition at line 333 of file arccore/src/common/arccore/common/Collection.h.
|
inlineexplicit |
Constructs a collection with acount elements.
Definition at line 342 of file arccore/src/common/arccore/common/Collection.h.
|
inlineprivate |
Definition at line 406 of file arccore/src/common/arccore/common/Collection.h.
|
inlineprotected |
Definition at line 397 of file arccore/src/common/arccore/common/Collection.h.
|
inline |
Definition at line 393 of file arccore/src/common/arccore/common/Collection.h.
|
pure virtual |
Removes all elements from the collection.
Implemented in Arcane::ListImplBase< T >.
|
inline |
Returns the number of elements in the collection.
Definition at line 352 of file arccore/src/common/arccore/common/Collection.h.
Referenced by Arcane::ListImplBase< T >::add(), Arcane::ListImplBase< T >::end(), Arcane::ListImplBase< T >::end(), and Arcane::ListImplBase< T >::end2().
|
pure virtual |
Returns a generic enumerator for the collection.
Implemented in Arcane::ListImplBase< T >.
|
inlinevirtual |
Event sent before removing all elements.
Definition at line 359 of file arccore/src/common/arccore/common/Collection.h.
Referenced by Arcane::ListImplBase< T >::clear().
|
inlinevirtual |
Event sent when all elements have been removed.
Definition at line 361 of file arccore/src/common/arccore/common/Collection.h.
Referenced by Arcane::ListImplBase< T >::clear().
|
inlinevirtual |
Event sent before inserting an element.
Definition at line 366 of file arccore/src/common/arccore/common/Collection.h.
Referenced by Arcane::ListImplBase< T >::add().
|
inlinevirtual |
Event sent after inserting an element.
Definition at line 368 of file arccore/src/common/arccore/common/Collection.h.
Referenced by Arcane::ListImplBase< T >::add().
|
inlinevirtual |
Event sent before removing an element.
Definition at line 373 of file arccore/src/common/arccore/common/Collection.h.
|
inlinevirtual |
Event sent after removing an element.
Definition at line 375 of file arccore/src/common/arccore/common/Collection.h.
|
inlinevirtual |
Definition at line 379 of file arccore/src/common/arccore/common/Collection.h.
|
inlinevirtual |
Definition at line 380 of file arccore/src/common/arccore/common/Collection.h.
|
inlinevirtual |
Definition at line 384 of file arccore/src/common/arccore/common/Collection.h.
|
private |
Definition at line 402 of file arccore/src/common/arccore/common/Collection.h.
|
private |
Definition at line 401 of file arccore/src/common/arccore/common/Collection.h.