NGSolve  4.9
Public Member Functions | Protected Attributes
ngstd::Array< T, TSIZE > Class Template Reference

Dynamic array container. More...

#include <array.hpp>

Inheritance diagram for ngstd::Array< T, TSIZE >:
ngstd::FlatArray< T, TSIZE > ngstd::BaseArrayObject< FlatArray< T > >

List of all members.

Public Member Functions

 Array ()
 Generate array of logical and physical size asize.
 Array (TSIZE asize)
 Array (TSIZE asize, T *adata)
 Generate array in user data.
 Array (TSIZE asize, LocalHeap &lh)
 Generate array in user data.
 Array (const Array< T > &a2)
 array copy
 Array (const Array< T > &a2, const Array< T > &a3)
 array merge-copy
 ~Array ()
 if responsible, deletes memory
void SetSize (TSIZE nsize)
 Change logical size. If necessary, do reallocation. Keeps contents.
void SetAllocSize (int nallocsize)
 Change physical size. Keeps logical size. Keeps contents.
int Append (const T &el)
 Add element at end of array. reallocation if necessary.
Array< T > & operator+= (const T &el)
int Append (const Array< T > &source)
 Append array at end of array. reallocation if necessary.
void DeleteElement (int i)
 Delete element i. Move last element to position i.
void RemoveElement (int i)
 Delete element i. Move all remaining elements forward.
void DeleteLast ()
 Delete last element.
void DeleteAll ()
 Deallocate memory.
Arrayoperator= (const T &val)
 Fill array with val.
Arrayoperator= (const Array &a2)
 array copy
Arrayoperator= (const FlatArray< T, TSIZE > &a2)
 array copy
template<typename T2 , typename TA >
Arrayoperator= (const BaseArrayObject< T2, TA > &a2)
void Swap (Array &b)

Protected Attributes

TSIZE allocsize
 physical size of array
bool ownmem
 memory is responsibility of container

Detailed Description

template<class T, class TSIZE = int>
class ngstd::Array< T, TSIZE >

Dynamic array container.

Array<T> is an automatically increasing array container. The allocated memory doubles on overflow. Either the container takes care of memory allocation and deallocation, or the user provides one block of data.


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