DynRPG  v0.20
RM2k3 Plugin SDK
Public Member Functions | Public Attributes
RPG::DArray< T, base_ > Class Template Reference

Array class. More...

List of all members.

Public Member Functions

int base ()
 Returns the base of the array (zero in most cases)
T & operator[] (int index)
 Array access operator.
void resize (int newSize)
 Resizes the array.

Public Attributes

int size
 Size of the array.
T * items
 Pointer to array items.

Detailed Description

template<class T = void *, int base_ = 0>
class RPG::DArray< T, base_ >

Array class.


Member Function Documentation

template<class T = void *, int base_ = 0>
int RPG::DArray< T, base_ >::base ( ) [inline]

Returns the base of the array (zero in most cases)

template<class T = void *, int base_ = 0>
T& RPG::DArray< T, base_ >::operator[] ( int  index) [inline]

Array access operator.

Note:
This operator will throw an error if you try to access negative indexes. However, if you use an index which is higher than the current maximum, the array is resized.
template<class T = void *, int base_ = 0>
void RPG::DArray< T, base_ >::resize ( int  newSize) [inline]

Resizes the array.

New elements will be initialized with zero.

Parameters:
newSizeThe new number of elements in the array

Member Data Documentation

template<class T = void *, int base_ = 0>
T* RPG::DArray< T, base_ >::items

Pointer to array items.

template<class T = void *, int base_ = 0>
int RPG::DArray< T, base_ >::size

Size of the array.