In file array.hpp:

template<class T> class ARRAY

Dynamic array container.

Documentation

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.


Inheritance:


Public Methods

[more] ARRAY(int asize = 0)
Generate array of logical and physical size asize
[more] ARRAY(int asize, T* adata)
Generate array in user data
[more]explicit ARRAY(const ARRAY<T> & a2)
array copy
[more] ~ARRAY()
if responsible, deletes memory
[more]void SetSize(int nsize)
Change logical size.
[more]void SetAllocSize(int nallocsize)
Change physical size.
[more]int Append(const T & el)
Add element at end of array.
[more]void DeleteElement(int i)
Delete element i.
[more]void DeleteLast()
Delete last element.
[more]void DeleteAll()
Deallocate memory
[more]ARRAY& operator= (const T & val)
Fill array with val
[more]ARRAY& operator= (const ARRAY & a2)
array copy

Protected Fields

[more]int allocsize
physical size of array
[more]bool ownmem
memory is responsibility of container

Private Methods

[more]void ReSize(int minsize)
resize array, at least to size minsize.


Inherited from FlatArray:

Public Methods

oint Size() const
oT& operator[] (int i)
oconst T& operator[] (int i) const
oT& Last()
oconst T& Last() const

Protected Fields

oint size
oT* data

oint allocsize
physical size of array

obool ownmem
memory is responsibility of container

o ARRAY(int asize = 0)
Generate array of logical and physical size asize

o ARRAY(int asize, T* adata)
Generate array in user data

oexplicit ARRAY(const ARRAY<T> & a2)
array copy

o ~ARRAY()
if responsible, deletes memory

ovoid SetSize(int nsize)
Change logical size. If necessary, do reallocation. Keeps contents.

ovoid SetAllocSize(int nallocsize)
Change physical size. Keeps logical size. Keeps contents.

oint Append(const T & el)
Add element at end of array. reallocation if necessary.

ovoid DeleteElement(int i)
Delete element i. Move last element to position i.

ovoid DeleteLast()
Delete last element.

ovoid DeleteAll()
Deallocate memory

oARRAY& operator= (const T & val)
Fill array with val

oARRAY& operator= (const ARRAY & a2)
array copy

ovoid ReSize(int minsize)
resize array, at least to size minsize. copy contents


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.