![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/Array.h>
Inheritance diagram for AllocArray< T >:Public Member Functions | |
| AllocArray (void) | |
| AllocArray (int count, T *buffer) | |
| AllocArray (int count) | |
| AllocArray (int count, const T &val) | |
| AllocArray (const Array< T > &t) | |
| AllocArray (const AllocArray< T > &t) | |
| ~AllocArray (void) | |
| void | copy (const Array< T > &t) |
| void | tie (int cnt, T *buffer) |
| void | tie (const Array< T > &t) |
| AllocArray< T > & | operator= (const Array< T > &t) |
| AllocArray< T > & | operator= (const AllocArray< T > &t) |
Public Member Functions inherited from Array< T > | |
| Array (void) | |
| Array (int count, T *buffer) | |
| const T * | buffer (void) const |
| T * | buffer (void) |
| int | size (void) const |
| void | set (int count, T *buffer) |
| void | set (const Array< T > &t) |
| void | copy (const Array &t) |
| void | fill (const T &val) |
| const T * | operator() (void) const |
| T * | operator() (void) |
| Array< T > & | operator= (const Array< T > &t) |
| Iter | items (void) const |
| Iter | operator* (void) const |
| Iter | begin (void) const |
| Iter | end (void) const |
| Iterable< BackIter > | back () const |
| int | count (void) const |
| bool | contains (const T &item) |
| template<class C > | |
| bool | containsAll (const C &c) |
| bool | isEmpty (void) const |
| operator bool (void) const | |
| bool | equals (const Array< T > &a) const |
| bool | operator== (const Array< T > &a) const |
| bool | operator!= (const Array< T > &a) const |
| bool | operator<= (const Array< T > &a) const |
| bool | operator< (const Array< T > &a) const |
| bool | operator>= (const Array< T > &a) const |
| bool | operator> (const Array< T > &a) const |
| int | length (void) const |
| const T & | get (int idx) const |
| int | indexOf (const T &v, int i=0) const |
| int | lastIndexOf (const T &v, int i=-1) const |
| const T & | operator[] (int idx) const |
| void | set (int idx, const T &val) |
| void | set (const MutIter &i, const T &val) |
| T & | get (int idx) |
| T & | operator[] (int idx) |
| MutIter | begin (void) |
| MutIter | end (void) |
| Iterable< BackMutIter > | back () |
Additional Inherited Members | |
Public Types inherited from Array< T > | |
| typedef T | t |
| typedef Array< T > | self_t |
Static Public Attributes inherited from Array< T > | |
| static const Array< T > | null |
Protected Attributes inherited from Array< T > | |
| int | cnt |
| T * | buf |
An AllocArray is an Array that manages its own memory. It may be built giving its size and from another C array or Array. It will create its memory to store the array and it will free it at destruction time.
Only the set() methods can assign to the AllocArray a memory not allocated by itself. If such a method is called, it will receive the given array (and memory) and will free it when it will be destructed.
| T | Type of elements stored in the array. |
|
inline |
Build an empty array.
|
inline |
Build an array by copying the given array.
| count | Element count. |
| buffer | Containing the element to copy. |
|
inline |
Allocate an array with count size.
| count | Array element count. |
|
inline |
Allocate an array with count element and initialize them with val.
| count | Element count. |
| val | Initialization value. |
References Array< T >::fill().
|
inline |
Build a copy of the given array.
References Array< T >::copy().
|
inline |
Build a copy of the given array.
References Array< T >::copy().
|
inline |
References Array< T >::buf.
Perform a copy inside the current array of the given array.
| t | Copied array. |
References Array< T >::buf, Array< T >::copy(), Array< T >::count(), and Array< T >::set().
Referenced by AllocArray< T >::operator=().
|
inline |
Same as copy().
References AllocArray< T >::copy().
|
inline |
Same as copy().
References AllocArray< T >::copy().
References Array< T >::buf, and Array< T >::set().
|
inline |
References Array< T >::buf, Array< T >::buffer(), and Array< T >::set().