Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::ListImplBase< T > Class Template Reference

Public Types

typedef CollectionImplT< T > BaseClass
typedef const T & ObjectRef
typedef T value_type
 Type of array elements.
typedef value_typeiterator
 Type of iterator over an array element.
typedef const value_typeconst_iterator
 Type of constant iterator over an array element.
typedef value_typepointer
 Type pointer of an array element.
typedef const value_typeconst_pointer
 Type constant pointer of an array element.
typedef value_typereference
 Type reference of an array element.
typedef const value_typeconst_reference
 Type constant reference of an array element.
typedef IterT< ListImplBase< T > > iter
 Type of an iterator over the entire array.
typedef ConstIterT< ListImplBase< T > > const_iter
 Type of a constant iterator over the entire array.
Public Types inherited from Arcane::CollectionImplT< T >
typedef const T & ObjectRef
typedef T * ObjectIterator
typedef const T * ConstObjectIterator
Public Types inherited from Arcane::CollectionImplBase
typedef Integer size_type
 Type indexing the array.
typedef ptrdiff_t difference_type
 Type of a distance between array iterator elements.

Public Member Functions

 ListImplBase ()=default
 Constructs an empty array.
void assign (const ListImplBase< T > &s)
 Copies the array from s.
void assign (const ConstArrayView< T > &s)
 Copies the array from s.
void assign (const ArrayView< T > &s)
 Copies the array from s.
T & operator[] (Integer i)
 i-th element of the array.
const T & operator[] (Integer i) const
 i-th element of the array.
iterator begin () override
 Returns an iterator to the first element of the array.
iterator end () override
 Returns an iterator to the first element after the end of the array.
const_iterator begin () const override
 Returns a constant iterator to the first element of the array.
const_iterator end () const override
 Returns a constant iterator to the first element after the end of the array.
T * begin2 () const override
 Returns a pointer to the first element of the array.
T * end2 () const override
 Returns a pointer to the first element after the end of the array.
template<class Function>
Function each (Function f)
 Applies the functor f to all elements of the array.
void reserve (Integer new_capacity)
 Signals that memory should be reserved for new_capacity elements This is just an indication. The derived class is free not to take it into account.
Integer capacity () const
 Returns the number of allocated elements in the array.
void clear () override
 Removes all elements from the collection.
void add (ObjectRef elem) override
 Adds element elem to the end of the array.
bool remove (ObjectRef element) override
void removeAt (Integer index) override
const_iterator find (ObjectRef element) const
bool contains (ObjectRef element) const override
EnumeratorImplBaseenumerator () const override
 Returns a generic enumerator for the collection.
void resize (Integer new_size)
 Changes the size of the array. new_size is the new number of elements in the array.
Public Member Functions inherited from Arcane::CollectionImplT< T >
template<class Function>
Function each (Function f)
 Applies the functor f to all elements of the collection.
Public Member Functions inherited from Arcane::CollectionImplBase
 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 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 ()
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 _removeAt (Integer index)
Integer _capacity () const
void _arrayCopy (const ListImplBase< T > &array)
void _arrayCopy (const ConstArrayView< T > &array)
void _arrayCopy (const ArrayView< T > &array)
void _arrayCopy (const T *from_ptr, Integer from_size)
T * _ptr ()
 Returns a pointer to the array.
const T * _ptr () const
Protected Member Functions inherited from Arcane::CollectionImplBase
void _setCount (Integer acount)

Detailed Description

template<class T>
class Arcane::ListImplBase< T >

Definition at line 42 of file arccore/src/common/arccore/common/List.h.

Member Typedef Documentation

◆ BaseClass

template<class T>
typedef CollectionImplT<T> Arcane::ListImplBase< T >::BaseClass

Definition at line 47 of file arccore/src/common/arccore/common/List.h.

◆ const_iter

template<class T>
typedef ConstIterT<ListImplBase<T> > Arcane::ListImplBase< T >::const_iter

Type of a constant iterator over the entire array.

Definition at line 71 of file arccore/src/common/arccore/common/List.h.

◆ const_iterator

template<class T>
typedef const value_type* Arcane::ListImplBase< T >::const_iterator

Type of constant iterator over an array element.

Definition at line 58 of file arccore/src/common/arccore/common/List.h.

◆ const_pointer

template<class T>
typedef const value_type* Arcane::ListImplBase< T >::const_pointer

Type constant pointer of an array element.

Definition at line 62 of file arccore/src/common/arccore/common/List.h.

◆ const_reference

template<class T>
typedef const value_type& Arcane::ListImplBase< T >::const_reference

Type constant reference of an array element.

Definition at line 66 of file arccore/src/common/arccore/common/List.h.

◆ iter

template<class T>
typedef IterT<ListImplBase<T> > Arcane::ListImplBase< T >::iter

Type of an iterator over the entire array.

Definition at line 69 of file arccore/src/common/arccore/common/List.h.

◆ iterator

template<class T>
typedef value_type* Arcane::ListImplBase< T >::iterator

Type of iterator over an array element.

Definition at line 56 of file arccore/src/common/arccore/common/List.h.

◆ ObjectRef

template<class T>
typedef const T& Arcane::ListImplBase< T >::ObjectRef

Definition at line 51 of file arccore/src/common/arccore/common/List.h.

◆ pointer

template<class T>
typedef value_type* Arcane::ListImplBase< T >::pointer

Type pointer of an array element.

Definition at line 60 of file arccore/src/common/arccore/common/List.h.

◆ reference

template<class T>
typedef value_type& Arcane::ListImplBase< T >::reference

Type reference of an array element.

Definition at line 64 of file arccore/src/common/arccore/common/List.h.

◆ value_type

template<class T>
typedef T Arcane::ListImplBase< T >::value_type

Type of array elements.

Definition at line 54 of file arccore/src/common/arccore/common/List.h.

Member Function Documentation

◆ _arrayCopy() [1/4]

template<class T>
void Arcane::ListImplBase< T >::_arrayCopy ( const ArrayView< T > & array)
inlineprotected

Definition at line 281 of file arccore/src/common/arccore/common/List.h.

◆ _arrayCopy() [2/4]

template<class T>
void Arcane::ListImplBase< T >::_arrayCopy ( const ConstArrayView< T > & array)
inlineprotected

Definition at line 277 of file arccore/src/common/arccore/common/List.h.

◆ _arrayCopy() [3/4]

template<class T>
void Arcane::ListImplBase< T >::_arrayCopy ( const ListImplBase< T > & array)
inlineprotected

Definition at line 273 of file arccore/src/common/arccore/common/List.h.

◆ _arrayCopy() [4/4]

template<class T>
void Arcane::ListImplBase< T >::_arrayCopy ( const T * from_ptr,
Integer from_size )
inlineprotected

Definition at line 285 of file arccore/src/common/arccore/common/List.h.

◆ _capacity()

template<class T>
Integer Arcane::ListImplBase< T >::_capacity ( ) const
inlineprotected

Definition at line 266 of file arccore/src/common/arccore/common/List.h.

◆ _ptr() [1/2]

template<class T>
T * Arcane::ListImplBase< T >::_ptr ( )
inlineprotected

Returns a pointer to the array.

Warning
It is preferable not to use this method to access an element of the array because this pointer can be invalidated by resizing the array. Furthermore, accessing the array elements via this pointer allows no overflow checking, even in DEBUG mode.

Definition at line 305 of file arccore/src/common/arccore/common/List.h.

Referenced by add().

◆ _ptr() [2/2]

template<class T>
const T * Arcane::ListImplBase< T >::_ptr ( ) const
inlineprotected

Definition at line 310 of file arccore/src/common/arccore/common/List.h.

◆ _removeAt()

template<class T>
void Arcane::ListImplBase< T >::_removeAt ( Integer index)
inlineprotected

Definition at line 241 of file arccore/src/common/arccore/common/List.h.

◆ add()

template<class T>
void Arcane::ListImplBase< T >::add ( ObjectRef elem)
inlineoverridevirtual

◆ assign() [1/3]

template<class T>
void Arcane::ListImplBase< T >::assign ( const ArrayView< T > & s)
inline

Copies the array from s.

Definition at line 91 of file arccore/src/common/arccore/common/List.h.

◆ assign() [2/3]

template<class T>
void Arcane::ListImplBase< T >::assign ( const ConstArrayView< T > & s)
inline

Copies the array from s.

Definition at line 86 of file arccore/src/common/arccore/common/List.h.

◆ assign() [3/3]

template<class T>
void Arcane::ListImplBase< T >::assign ( const ListImplBase< T > & s)
inline

Copies the array from s.

Definition at line 81 of file arccore/src/common/arccore/common/List.h.

References ListImplBase().

◆ begin() [1/2]

template<class T>
const_iterator Arcane::ListImplBase< T >::begin ( ) const
inlineoverridevirtual

Returns a constant iterator to the first element of the array.

Implements Arcane::CollectionImplT< T >.

Definition at line 129 of file arccore/src/common/arccore/common/List.h.

◆ begin() [2/2]

template<class T>
iterator Arcane::ListImplBase< T >::begin ( )
inlineoverridevirtual

Returns an iterator to the first element of the array.

Implements Arcane::CollectionImplT< T >.

Definition at line 119 of file arccore/src/common/arccore/common/List.h.

Referenced by each().

◆ begin2()

template<class T>
T * Arcane::ListImplBase< T >::begin2 ( ) const
inlineoverridevirtual

Returns a pointer to the first element of the array.

Implements Arcane::CollectionImplT< T >.

Definition at line 140 of file arccore/src/common/arccore/common/List.h.

Referenced by end2(), and enumerator().

◆ capacity()

template<class T>
Integer Arcane::ListImplBase< T >::capacity ( ) const
inline

Returns the number of allocated elements in the array.

This is just an indication. The derived class is free not to take it into account.

Definition at line 178 of file arccore/src/common/arccore/common/List.h.

◆ clear()

template<class T>
void Arcane::ListImplBase< T >::clear ( )
inlineoverridevirtual

Removes all elements from the collection.

Implements Arcane::CollectionImplBase.

Definition at line 183 of file arccore/src/common/arccore/common/List.h.

References Arcane::CollectionImplBase::onClear(), and Arcane::CollectionImplBase::onClearComplete().

◆ contains()

template<class T>
bool Arcane::ListImplBase< T >::contains ( ObjectRef element) const
inlineoverridevirtual

◆ each()

template<class T>
template<class Function>
Function Arcane::ListImplBase< T >::each ( Function f)
inline

Applies the functor f to all elements of the array.

Definition at line 155 of file arccore/src/common/arccore/common/List.h.

References begin(), and end().

◆ end() [1/2]

template<class T>
const_iterator Arcane::ListImplBase< T >::end ( ) const
inlineoverridevirtual

Returns a constant iterator to the first element after the end of the array.

Implements Arcane::CollectionImplT< T >.

Definition at line 134 of file arccore/src/common/arccore/common/List.h.

References Arcane::CollectionImplBase::count().

◆ end() [2/2]

template<class T>
iterator Arcane::ListImplBase< T >::end ( )
inlineoverridevirtual

Returns an iterator to the first element after the end of the array.

Implements Arcane::CollectionImplT< T >.

Definition at line 124 of file arccore/src/common/arccore/common/List.h.

References Arcane::CollectionImplBase::count().

Referenced by each().

◆ end2()

template<class T>
T * Arcane::ListImplBase< T >::end2 ( ) const
inlineoverridevirtual

Returns a pointer to the first element after the end of the array.

Implements Arcane::CollectionImplT< T >.

Definition at line 146 of file arccore/src/common/arccore/common/List.h.

References begin2(), and Arcane::CollectionImplBase::count().

Referenced by enumerator().

◆ enumerator()

template<class T>
EnumeratorImplBase * Arcane::ListImplBase< T >::enumerator ( ) const
overridevirtual

Returns a generic enumerator for the collection.

Implements Arcane::CollectionImplBase.

Definition at line 428 of file arccore/src/common/arccore/common/List.h.

References begin2(), and end2().

◆ find()

template<class T>
const_iterator Arcane::ListImplBase< T >::find ( ObjectRef element) const
inline

Definition at line 222 of file arccore/src/common/arccore/common/List.h.

◆ operator[]() [1/2]

template<class T>
T & Arcane::ListImplBase< T >::operator[] ( Integer i)
inline

i-th element of the array.

In check mode, checks for overflows.

Definition at line 103 of file arccore/src/common/arccore/common/List.h.

◆ operator[]() [2/2]

template<class T>
const T & Arcane::ListImplBase< T >::operator[] ( Integer i) const
inline

i-th element of the array.

In check mode, checks for overflows.

Definition at line 113 of file arccore/src/common/arccore/common/List.h.

◆ remove()

template<class T>
bool Arcane::ListImplBase< T >::remove ( ObjectRef element)
inlineoverridevirtual

◆ removeAt()

template<class T>
void Arcane::ListImplBase< T >::removeAt ( Integer index)
inlineoverridevirtual

◆ reserve()

template<class T>
void Arcane::ListImplBase< T >::reserve ( Integer new_capacity)
inline

Signals that memory should be reserved for new_capacity elements This is just an indication. The derived class is free not to take it into account.

Definition at line 167 of file arccore/src/common/arccore/common/List.h.

◆ resize()

template<class T>
void Arcane::ListImplBase< T >::resize ( Integer new_size)
inline

Changes the size of the array. new_size is the new number of elements in the array.

Definition at line 258 of file arccore/src/common/arccore/common/List.h.


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