NGSolve  5.3
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 >:
Inheritance graph
[legend]
Collaboration diagram for ngstd::Array< T, TSIZE >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

INLINE Array ()
 Generate array of logical and physical size asize.
INLINE Array (TSIZE asize)
INLINE Array (TSIZE asize, T *adata)
 Generate array in user data.
INLINE Array (TSIZE asize, LocalHeap &lh)
 Generate array in user data.
INLINE Array (Array &&a2)
INLINE Array (const Array &a2)
 array copy
template<typename TA >
 Array (const BaseArrayObject< TA > &a2)
 Array (std::initializer_list< T > list)
 Array (const Array< T > &a2, const Array< T > &a3)
 array merge-copy
INLINE ~Array ()
 if responsible, deletes memory
INLINE void NothingToDelete ()
 we tell the compiler that there is no need for deleting the array ..
INLINE void SetSize (TSIZE nsize)
 Change logical size. If necessary, do reallocation. Keeps contents.
INLINE void SetSize0 ()
INLINE void SetAllocSize (TSIZE nallocsize)
 Change physical size. Keeps logical size. Keeps contents.
INLINE TSIZE AllocSize () const
 Change physical size. Keeps logical size. Keeps contents.
INLINE const ArrayAssign (TSIZE asize, LocalHeap &lh)
 assigns memory from local heap
INLINE TSIZE Append (const T &el)
 Add element at end of array. reallocation if necessary.
INLINE Array< T > & operator+= (const T &el)
INLINE TSIZE Append (FlatArray< T > source)
 Append array at end of array. reallocation if necessary.
INLINE void DeleteElement (int i)
 Delete element i. Move last element to position i.
INLINE void RemoveElement (TSIZE i)
 Delete element i. Move all remaining elements forward.
INLINE void DeleteLast ()
 Delete last element.
INLINE void DeleteAll ()
 Deallocate memory.
INLINE Arrayoperator= (const T &val)
 Fill array with val.
INLINE Arrayoperator= (const Array &a2)
 array copy
INLINE Arrayoperator= (Array &&a2)
 steal array
INLINE Arrayoperator= (const FlatArray< T, TSIZE > &a2)
 array copy
template<typename T2 >
Arrayoperator= (const BaseArrayObject< T2 > &a2)
template<typename... ARGS>
Arrayoperator= (Tuple< ARGS...> tup)
INLINE void Swap (Array &b)

Protected Attributes

TSIZE allocsize
 physical size of array
T * mem_to_delete
 that's the data we have to delete, nullptr for not owning the memory

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: