class Array

A list based Array. More...

Full nameTelEngine::Array
Definition#include <yateclass.h>
InheritsTelEngine::RefObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

A simple Array class derivated from RefObject It uses one ObjList to keep the pointers to other ObjList's. Data is organized in columns - the main ObjList holds pointers to one ObjList for each column. This class has been written by Diana

explicit  Array (int columns = 0, int rows = 0)

Array

Creates a new empty array.

Parameters:
columnsInitial number of columns
rowsInitial number of rows

 ~Array ()

~Array

[virtual]

Destructor. Destructs all objects in the array

void*  getObject (const String& name)

getObject

[const virtual]

Get a pointer to a derived class given that class name

Parameters:
nameName of the class we are asking for

Returns: Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from RefObject.

bool  addRow (ObjList* row = 0, int index = -1)

addRow

Insert a row of objects

Parameters:
rowList of objects to insert or NULL
indexNumber of the row to insert before, negative to append

Returns: True for success, false if index was larger than the array

bool  addColumn (ObjList* column = 0, int index = -1)

addColumn

Insert a column of objects

Parameters:
columnList of objects to insert or NULL
indexNumber of the column to insert before, negative to append

Returns: True for success, false if index was larger than the array

bool  delRow (int index)

delRow

Delete an entire row of objects

Parameters:
indexNumber of the row to delete

Returns: True for success, false if index was out of bounds

bool  delColumn (int index)

delColumn

Delete an entire column of objects

Parameters:
indexNumber of the column to delete

Returns: True for success, false if index was out of bounds

GenObject*  get (int column, int row)

get

[const]

Retrieve an object from the array

Parameters:
columnNumber of the column in the array
rowNumber of the row in the array

Returns: Pointer to the stored object, NULL for out of bound indexes

GenObject*  take (int column, int row)

take

Retrieve and remove an object from the array

Parameters:
columnNumber of the column in the array
rowNumber of the row in the array

Returns: Pointer to the stored object, NULL for out of bound indexes

bool  set (GenObject* obj, int column, int row)

set

Store an object in the array

Parameters:
objObject to store in the array
columnNumber of the column in the array
rowNumber of the row in the array

Returns: True for success, false if indexes were out of bounds

inline int  getRows ()

getRows

[const]

Get the number of rows in the array

Returns: Total number of rows

inline int  getColumns ()

getColumns

[const]

Get the number of columns in the array

Returns: Total number of columns

inline ObjList*  getColumn (int column)

getColumn

[const]

Retrieve a column. Note: Use the returned list only to get or set data. List items must not be removed or appended

Parameters:
columnColumn to retrieve

Returns: Pointer to column list, NULL for out of bound indexes


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.