Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

rmStatusArray Class Template Reference

#include <rmStatusArray.h>

Inheritance diagram for rmStatusArray:

rmBaseArray IBaseAccessor rmRefArray List of all members.

Public Methods

 rmStatusArray ()
virtual ~rmStatusArray ()
virtual int addDefaultElement (unsigned long aID)
 add a default element into the table. More...

virtual int updateStatus (T &aElement)
 update the status of an element. More...

virtual int setStatus (T &aElement, unsigned long aID, long aStatus)
 set the status of an element. More...


Detailed Description

template<class T>
class rmStatusArray< T >

A template class which inheriets most of its method from rmBaseArray and whose elements all have a member called "status".

The datatype for this template class must have a member named "status". This member will be used by SNMP Subagent to manage the current status of the element.

Valid "status" are: ACTIVE, NOTINSERVICE, NOTREADY Other commands including: CREATEANDGO, CREATEANDWAIT, DESTORY.

Definition at line 20 of file rmStatusArray.h.


Constructor & Destructor Documentation

template<class T>
rmStatusArray< T >::rmStatusArray   [inline]
 

Definition at line 23 of file rmStatusArray.h.

template<class T>
virtual rmStatusArray< T >::~rmStatusArray   [inline, virtual]
 

Definition at line 24 of file rmStatusArray.h.


Member Function Documentation

template<class T>
int rmStatusArray< T >::addDefaultElement unsigned long    aID [virtual]
 

add a default element into the table.

Add a default element into the table without providing a real element. The new element will contain default values. And the status of the newly created element will be set to NOTREADY.

Parameters:
aID  The unique ID valud of this element.
Precondition:
Call getNewId() to get the id value for this element.
See also:
getNewId()
Returns:
RMCLIENT_SUCCESS is successful. or RMCLIENT_ERROR_BASE_INSERT if failure.
Remarks:
This function overrides the addDefaultElement() in rmBaseArray.h

Reimplemented from rmBaseArray.

Reimplemented in eventQuery.

Definition at line 55 of file rmStatusArray.h.

References rmBaseArray::addElement, and NOTREADY.

template<class T>
int rmStatusArray< T >::setStatus T &    aElement,
unsigned long    aID,
long    aStatus
[virtual]
 

set the status of an element.

Set the status of an element.

Parameters:
aElement  contains the actual element.
aID  The unique ID for this element
aStatus  The new status.
Returns:
RMCLIENT_SUCCESS is successful. or RMCLIENT_ERROR_STATE if failure.
Remarks:
This is the default implementation of the setStatus() call. Derived class can have their own implementation if needed. This particular implementation simply changes the status without any additional procedures. This is intended for those elements who are merely data structures that have no operations associated with them.

Definition at line 115 of file rmStatusArray.h.

References ACTIVE, NOTINSERVICE, NOTREADY, RMCLIENT_ERROR_NOSUCHVALUE, RMCLIENT_ERROR_STATE, and RMCLIENT_SUCCESS.

template<class T>
int rmStatusArray< T >::updateStatus T &    aElement [virtual]
 

update the status of an element.

Update the status of an element. This function utilizes elementIsReady() to test if the element is ready for service. The status will be set according to the previous status and the result of elementIsReady() call.

Parameters:
aElement  contains the actual element.
See also:
elementIsReady()
Returns:
RMCLIENT_SUCCESS is successful. or RMCLIENT_ERROR_BASE_INSERT if failure.
Remarks:
This function is usually called after the element is updated or changed. elementIsReady() should be implemented by the derived class.

Definition at line 84 of file rmStatusArray.h.

References ACTIVE, rmBaseArray::elementIsReady, NOTINSERVICE, NOTREADY, and RMCLIENT_SUCCESS.


The documentation for this class was generated from the following file:
Generated on Tue Sep 10 16:46:34 2002 for ResourceMonitorSNMPSubagent by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002