class ObjVector

A vector holding GenObjects. More...

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

Public Methods


Detailed Description

Simple vector class that holds objects derived from GenObject

inline explicit  ObjVector (bool autodelete = true)

ObjVector

Constructor of a zero capacity vector

Parameters:
autodeleteTrue to delete objects on destruct, false otherwise

 ObjVector (unsigned int maxLen, bool autodelete = true)

ObjVector

Constructor of an empty vector

Parameters:
maxLenMaximum number of objects the vector can hold
autodeleteTrue to delete objects on destruct, false otherwise

 ObjVector (ObjList& list, bool move = true, unsigned int maxLen = 0, bool autodelete = true)

ObjVector

Constructor from an object list

Parameters:
listList of objects to store in vector
moveTrue to move elements from list, false to just copy the pointer
maxLenMaximum number of objects to put in vector, zero to put all
autodeleteTrue to delete objects on destruct, false otherwise

 ~ObjVector ()

~ObjVector

[virtual]

Destroys the vector and the objects if automatic delete is set

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 GenObject.

inline unsigned int  length ()

length

[const]

Get the capacity of the vector

Returns: Number of items the vector can hold

unsigned int  count ()

count

[const]

Get the number of non-null objects in the vector

Returns: Count of items

inline GenObject*  at (int index)

at

[const]

Get the object at a specific index in vector

Parameters:
indexIndex of the object to retrieve

Returns: Pointer to the object or NULL

inline GenObject*  operator[] (signed int index)

operator[]

[const]

Indexing operator with signed parameter

Parameters:
indexIndex of the object to retrieve

Returns: Pointer to the object or NULL

inline GenObject*  operator[] (unsigned int index)

operator[]

[const]

Indexing operator with unsigned parameter

Parameters:
indexIndex of the object to retrieve

Returns: Pointer to the object or NULL

unsigned int  assign (ObjList& list, bool move = true, unsigned int maxLen = 0)

assign

Clear the vector and assign objects from a list

Parameters:
listList of objects to store in vector
moveTrue to move elements from list, false to just copy the pointer
maxLenMaximum number of objects to put in vector, zero to put all

Returns: Capacity of the vector

GenObject*  take (unsigned int index)

take

Retrieve and remove an object from the vector

Parameters:
indexIndex of the object to retrieve

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

bool  set (GenObject* obj, unsigned int index)

set

Store an object in the vector

Parameters:
objObject to store in vector
indexIndex of the object to store

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

int  index (const GenObject* obj)

index

[const]

Get the position in vector of a GenObject by a pointer to it

Parameters:
objPointer to the object to search for

Returns: Index of object in vector, -1 if not found

int  index (const String& str)

index

[const]

Get the position in vector of the first GenObject with a given value

Parameters:
strString value (toString) of the object to search for

Returns: Index of object in vector, -1 if not found

void  clear ()

clear

Clear the vector and optionally delete all contained objects

inline bool  autoDelete ()

autoDelete

Get the automatic delete flag

Returns: True if will delete objects on destruct, false otherwise

inline void  setDelete (bool autodelete)

setDelete

Set the automatic delete flag

Parameters:
autodeleteTrue to delete objects on destruct, false otherwise


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