Class that implements functionality of the Collection container.
More...
template<class T>
class daal::services::interface1::Collection< T >
- Template Parameters
-
T | Type of an object stored in the container |
Default constructor. Sets the size and capacity to 0.
Constructor. Creates a collection with n empty elements
- Parameters
-
Constructor. Creates a collection from the array
- Parameters
-
[in] | n | Number of elements |
[in] | array | Array with elements |
Copy constructor
- Parameters
-
[in] | other | Copied collection |
size_t capacity |
( |
| ) |
const |
|
inline |
Size of an allocated storage
- Returns
- Size of the allocated storage
Clears a collection: removes an array, sets the size and capacity to 0
Returns pointer to the underlying array serving as element storage
- Returns
- Pointer to the array
Returns const pointer to the underlying array serving as element storage
- Returns
- Const pointer to the array
Erase an element from a position
- Parameters
-
Element access
- Parameters
-
[in] | index | Index of an accessed element |
- Returns
- Reference to the element
const T& get |
( |
size_t |
index | ) |
const |
|
inline |
Const element access
- Parameters
-
[in] | index | Index of an accessed element |
- Returns
- Reference to the element
bool insert |
( |
const size_t |
pos, |
|
|
const T & |
x |
|
) |
| |
|
inline |
Insert an element into a position
- Parameters
-
[in] | pos | Position to set |
[in] | x | Element to set |
bool insert |
( |
const size_t |
pos, |
|
|
Collection< T > & |
other |
|
) |
| |
|
inline |
Insert a collection to another collection into a position
- Parameters
-
Adds an element to the end of a collection
- Parameters
-
T& operator[] |
( |
size_t |
index | ) |
|
|
inline |
Element access
- Parameters
-
[in] | index | Index of an accessed element |
- Returns
- Reference to the element
const T& operator[] |
( |
size_t |
index | ) |
const |
|
inline |
Const element access
- Parameters
-
[in] | index | Index of an accessed element |
- Returns
- Reference to the element
Adds an element to the end of a collection
- Parameters
-
bool resize |
( |
size_t |
newCapacity | ) |
|
|
inline |
Changes the size of a storage
- Parameters
-
[in] | newCapacity | Size of a new storage. |
bool safe_push_back |
( |
const T & |
x | ) |
|
|
inline |
Adds an element to the end of a collection
- Parameters
-
- Returns
- True if the element was successfully added
Size of a collection
- Returns
- Size of the collection
The documentation for this class was generated from the following file: