template<class TYPE> class DArray: public ArrayBaseT<TYPE>

Dynamic array for general types.

Inheritance:


Public Methods

[more] DArray()
Constructs an empty array.
[more] DArray(int hibound)
Constructs an array with subscripts in range 0 to hibound.
[more] DArray(int lobound, int hibound)
Constructs an array with subscripts in range lobound to hibound.


Inherited from ArrayBaseT:

Public Methods

oTYPE& operator[](int n)
oconst TYPE& operator[](int n) const
o operator TYPE* ()
o operator const TYPE* () const
ovoid ins(int n, const TYPE &val, unsigned int howmany=1)
ovoid sort()
ovoid sort(int lo, int hi)


Inherited from ArrayBase:

Public Methods

oint size() const
oint lbound() const
oint hbound() const
ovoid empty()
ovoid touch(int n)
ovoid resize(int hibound)
ovoid resize(int lobound, int hibound)
ovoid shift(int disp)
ovoid del(int n, unsigned int howmany=1)


Documentation

Dynamic array for general types. Template class DArray<TYPE> implements an array of elements of type TYPE. Each element is identified by an integer subscript. The valid subscripts range is defined by dynamically adjustable lower- and upper-bounds. Besides accessing and setting elements, member functions are provided to insert or delete elements at specified positions.

This template class must be able to access

The class offers "copy-on-demand" policy, which means that when you copy the array object, array elements will stay intact as long as you don't try to modify them. As soon as you make an attempt to change array contents, the copying is done automatically and transparently for you - the procedure that we call "copy-on-demand". This is the main difference between this class and GArray (now obsolete)

Please note that most of the methods are implemented in the base classes ArrayBase and ArrayBaseT.

o DArray()
Constructs an empty array. The valid subscript range is initially empty. Member function touch and resize provide convenient ways to enlarge the subscript range.

o DArray(int hibound)
Constructs an array with subscripts in range 0 to hibound. The subscript range can be subsequently modified with member functions touch and resize.
Parameters:
hibound - upper bound of the initial subscript range.

o DArray(int lobound, int hibound)
Constructs an array with subscripts in range lobound to hibound. The subscript range can be subsequently modified with member functions touch and resize.
Parameters:
lobound - lower bound of the initial subscript range.
hibound - upper bound of the initial subscript range.


Direct child classes:
DPArray

Alphabetic index HTML hierarchy of classes or Java


DjVu is a trademark of LizardTech, Inc.
All other products mentioned are registered trademarks or trademarks of their respective companies.