In file array.hpp:

template<class T> class FlatArray

A simple array container.

Documentation

A simple array container. Array represented by size and data-pointer. No memory allocation and deallocation, must be provided by user. Helper functions for printing. Optional range check by macro RANGE_CHECK

Inheritance:


Public Methods

[more] FlatArray()
initialize array
[more] FlatArray(int asize, T* adata)
provide size and memory
[more] FlatArray(int asize, LocalHeap & lh)
memory from local heap
[more]int Size() const
the size
[more]T& operator[] (int i) const
Access array.access array.
[more]T& Last()
access last element.
[more]const T& Last() const
access last element.
[more]FlatArray<T> Part(int pos)
takes sub-array starting from position pos
[more]FlatArray<T> Part(int pos, int subsize)
takes subsize elements starting from position pos
[more]const FlatArray<T> Range(int start, int end)
takes range starting from position start of end-start elements
[more]int Pos(const T & elem) const
first position of element elem, returns -1 if element not contained in array
[more]inline bool Contains(const T & elem) const
does the array contain element elem ?
[more]const FlatArray& operator= (const T & val) const
Fill array with value val
[more]FlatArray& operator= (const FlatArray & a2)
copies pointers

Protected Fields

[more]int size
the size
[more]T* data
the data

oint size
the size

oT* data
the data

o FlatArray()
initialize array

o FlatArray(int asize, T* adata)
provide size and memory

o FlatArray(int asize, LocalHeap & lh)
memory from local heap

oint Size() const
the size

oT& operator[] (int i) const
Access array. range check by macro CHECK_RANGEaccess array. range check by macro CHECK_RANGE

oT& Last()
access last element. check by macro CHECK_RANGE

oconst T& Last() const
access last element. check by macro CHECK_RANGE

oFlatArray<T> Part(int pos)
takes sub-array starting from position pos

oFlatArray<T> Part(int pos, int subsize)
takes subsize elements starting from position pos

oconst FlatArray<T> Range(int start, int end)
takes range starting from position start of end-start elements

oint Pos(const T & elem) const
first position of element elem, returns -1 if element not contained in array

oinline bool Contains(const T & elem) const
does the array contain element elem ?

oconst FlatArray& operator= (const T & val) const
Fill array with value val

oFlatArray& operator= (const FlatArray & a2)
copies pointers


Direct child classes:
ARRAY

Alphabetic index HTML hierarchy of classes or Java



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