#include <rmBaseArray.h>
Inheritance diagram for rmBaseArray:
Public Methods | |
rmBaseArray () | |
virtual | ~rmBaseArray () |
rmBaseArray (unsigned long aStartupID) | |
virtual size_t | getCount () const |
returns the current number of elements in the table. More... | |
virtual T * | getElement (unsigned long aID) |
returns a particular entry, not a const. More... | |
virtual const T * | getConstElement (unsigned long aID) |
returns a particular entry as a const. More... | |
virtual int | addElement (const T &aElement, unsigned long aID) |
insert an entry (element) into the table. More... | |
virtual int | newElement (const T &aElement, unsigned long &aID) |
create a new element in the table without aID. More... | |
virtual int | addDefaultElement (unsigned long aID) |
create a default new element. More... | |
virtual int | removeElement (unsigned long aID) |
delete an element. More... | |
virtual int | modifyElement (unsigned long aID, const T &aElement) |
modify an element. More... | |
virtual unsigned long | getNewId (void) |
returns the ID value of the next new element. More... | |
virtual unsigned long | getMaxId (void) const |
| |
virtual int | findId (unsigned long aID, map< unsigned long, T >::iterator *aPos=0) |
test if an ID is a valid element of the table. More... | |
virtual int | getNextId (unsigned long aID, unsigned long &aNextID) |
find the next valid ID in the table based on the input. More... | |
virtual int | init () |
initize the table. More... | |
virtual bool | elementIsReady (const T &aElement) const |
virtual int | getInteger32 (RMAttribute aName, unsigned long aID, long &aValue) |
virtual int | setInteger32 (RMAttribute aName, unsigned long aID, long aValue) |
virtual int | getUnsigned (RMAttribute aName, unsigned long aID, unsigned long &aValue) |
virtual int | setUnsigned (RMAttribute aName, unsigned long aID, unsigned long aValue) |
virtual int | getUnsigned64 (RMAttribute aName, unsigned long aID, u_int64_t &aValue) |
virtual int | setUnsigned64 (RMAttribute aName, unsigned long aID, u_int64_t aValue) |
virtual int | getUUIDString (RMAttribute aName, unsigned long aID, char *aUUIDStr) |
virtual int | setUUIDString (RMAttribute aName, unsigned long aID, char *aUUIDStr) |
virtual int | getUUID (RMAttribute aName, unsigned long aID, uuid_t aUUID) |
virtual int | getString (RMAttribute aName, unsigned long aID, char *&aBuf) |
virtual int | setString (RMAttribute aName, unsigned long aID, char *aBuf) |
virtual int | getBinary (RMAttribute aName, unsigned long aID, char *&aBuf, unsigned long &aLength) |
virtual int | findExactId (unsigned long aID) |
Protected Attributes | |
map< unsigned long, T > | mElementArray |
the table which holds all the elements. mElementArray is an associative array (STL map). So the key is the unique ID for every element in this array. More... | |
unsigned long | mMaxId |
the maximum ID issued so far. can be wrapped around. More... | |
map< unsigned long, T >::iterator | mPos |
the last referenced element. This is stored as a cache hoping that subsequent access are to the same element. More... |
This template defines some basic operations that can be performed on entries (elements) in a table.
Each entry (element) is an instance of a certain data type. Elements are referenced by their unique ID number.
Definition at line 69 of file rmBaseArray.h.
|
Definition at line 72 of file rmBaseArray.h. |
|
Definition at line 73 of file rmBaseArray.h. |
|
Definition at line 75 of file rmBaseArray.h. |
|
create a default new element.
Implements IBaseAccessor. Reimplemented in eventQuery. Definition at line 317 of file rmBaseArray.h. References addElement. |
|
insert an entry (element) into the table. Add an element, aElement, into the table. Using aID as the unique id number (key value).
Reimplemented in rmRefArray. Definition at line 259 of file rmBaseArray.h. References mElementArray, mMaxId, RMCLIENT_ERROR_BASE_ID, RMCLIENT_ERROR_BASE_INSERT, and RMCLIENT_SUCCESS. Referenced by rmStatusArray::addDefaultElement, addDefaultElement, and newElement. |
|
Reimplemented in eventQuery. Definition at line 125 of file rmBaseArray.h. Referenced by rmStatusArray::updateStatus. |
|
Implements IBaseAccessor. Definition at line 190 of file rmBaseArray.h. |
|
test if an ID is a valid element of the table. Test if aID is a valid id number in this table by searching through the table and find an element which id == aID.
Definition at line 392 of file rmBaseArray.h. References mElementArray, mPos, RMCLIENT_ERROR_BASE_ID, and RMCLIENT_SUCCESS. Referenced by rmRefArray::addRef, rmBaseArray< Monitor >::findExactId, getElement, rmRefArray::modifyElement, modifyElement, rmRefArray::release, rmRefArray::removeElement, and removeElement. |
|
Implements IBaseAccessor. Definition at line 185 of file rmBaseArray.h. |
|
returns a particular entry as a const.
Definition at line 84 of file rmBaseArray.h. |
|
returns the current number of elements in the table.
Implements IBaseAccessor. Definition at line 78 of file rmBaseArray.h. |
|
returns a particular entry, not a const. Returns the element which (id == aID)
Definition at line 228 of file rmBaseArray.h. References findId. Referenced by rmBaseArray< Monitor >::getConstElement. |
|
Implements IBaseAccessor. Reimplemented in eventQuery. Definition at line 130 of file rmBaseArray.h. |
|
Definition at line 111 of file rmBaseArray.h. |
|
returns the ID value of the next new element.
Implements IBaseAccessor. Definition at line 105 of file rmBaseArray.h. Referenced by newElement. |
|
find the next valid ID in the table based on the input. Finds the next valid element after the specified id value. Basically, the first element int the table whose id > aID. This function combined with getConstElement() above can be used as an iterator. For example:
unsigned long id(0), nid(0); while(!getNextId(id, nid)) { id = nid; const T * element = getConstElement(id); \\ do stuff with it here. }
Implements IBaseAccessor. Definition at line 448 of file rmBaseArray.h. References mElementArray, mPos, RMCLIENT_ERROR_BASE_ID, and RMCLIENT_SUCCESS. |
|
Implements IBaseAccessor. Reimplemented in eventQuery. Definition at line 175 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmGenericMonitorConfig. Definition at line 140 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmThresholdMonitorConfig. Definition at line 150 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmGenericMonitorControl. Definition at line 170 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmGenericMonitorControl. Definition at line 160 of file rmBaseArray.h. |
|
initize the table.
Reimplemented in rmMonitor. Definition at line 123 of file rmBaseArray.h. |
|
modify an element. Modify the element whose id == aID by assigning a new element to this id.
Reimplemented in rmRefArray. Definition at line 364 of file rmBaseArray.h. References findId, and RMCLIENT_SUCCESS. |
|
create a new element in the table without aID. Add an new element (aElement) into the table without sepcifing a ID number. If the pointer aID is provided, then the id value of the newly created element is recorded.
Definition at line 306 of file rmBaseArray.h. References addElement, and getNewId. |
|
delete an element. Remove the element whose id == aID from the table.
Implements IBaseAccessor. Reimplemented in eventQuery. Definition at line 336 of file rmBaseArray.h. References findId, mElementArray, mPos, and RMCLIENT_SUCCESS. |
|
Implements IBaseAccessor. Reimplemented in eventQuery. Definition at line 135 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in eventQuery. Definition at line 180 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmGenericMonitorConfig. Definition at line 145 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmThresholdMonitorConfig. Definition at line 155 of file rmBaseArray.h. |
|
Implements IBaseAccessor. Reimplemented in rmGenericMonitorControl. Definition at line 165 of file rmBaseArray.h. |
|
the table which holds all the elements. mElementArray is an associative array (STL map). So the key is the unique ID for every element in this array.
Definition at line 207 of file rmBaseArray.h. Referenced by rmRefArray::addElement, addElement, findId, rmBaseArray< Monitor >::getCount, getNextId, rmRefArray::removeElement, removeElement, and rmBaseArray< Monitor >::rmBaseArray. |
|
the maximum ID issued so far. can be wrapped around.
Definition at line 210 of file rmBaseArray.h. Referenced by rmRefArray::addElement, addElement, rmBaseArray< Monitor >::getMaxId, rmBaseArray< Monitor >::getNewId, and rmBaseArray< Monitor >::rmBaseArray. |
|
the last referenced element. This is stored as a cache hoping that subsequent access are to the same element.
Definition at line 214 of file rmBaseArray.h. Referenced by findId, getNextId, rmRefArray::removeElement, removeElement, and rmBaseArray< Monitor >::rmBaseArray. |