TestAndIncr Class Reference

TestAndIncr. More...

#include <snmp_textual_conventions.h>

Inheritance diagram for TestAndIncr:

MibLeaf MibEntry ThreadManager Synchronized

List of all members.

Public Member Functions

 TestAndIncr (const Oidx &)
virtual ~TestAndIncr ()
virtual long get_state ()
virtual void set_state (long)
virtual int set (const Vbx &)
 Set the receiver's value and backup its old value for a later undo.
virtual boolean value_ok (const Vbx &)
 Check whether the receiver's value may be set to the given new value.
virtual int prepare_set_request (Request *, int &)
 Let the receiver prepare a SNMP SET subrequest.
virtual boolean is_volatile ()
 Check whether the entry is volatile or not.


Detailed Description

TestAndIncr.

Represents integer-valued information used for atomic operations. When the management protocol is used to specify that an object instance having this syntax is to be modified, the new value supplied via the management protocol must precisely match the value presently held by the instance. If not, the management protocol set operation fails with an error of `inconsistentValue'. Otherwise, if the current value is the maximum value of 2^31-1 (2147483647 decimal), then the value held by the instance is wrapped to zero; otherwise, the value held by the instance is incremented by one. (Note that regardless of whether the management protocol set operation succeeds, the variable- binding in the request and response PDUs are identical.)

The value of the ACCESS clause for objects having this syntax is either `read-write' or `read-create'. When an instance of a columnar object having this syntax is created, any value may be supplied via the management protocol.

When the network management portion of the system is re- initialized, the value of every object instance having this syntax must either be incremented from its value prior to the re-initialization, or (if the value prior to the re- initialization is unknown) be set to a pseudo-randomly generated value."

This object for example is used to facilitate modification of table entries in the SNMP-TARGET-MIB module by multiple managers. In particular, it is useful when modifying the value of the snmpTargetAddrTagList object.

The procedure for modifying the snmpTargetAddrTagList object is as follows:

1. Retrieve the value of snmpTargetSpinLock and of snmpTargetAddrTagList.

2. Generate a new value for snmpTargetAddrTagList.

3. Set the value of snmpTargetSpinLock to the retrieved value, and the value of snmpTargetAddrTagList to the new value. If the set fails for the snmpTargetSpinLock object, go back to step 1."


Constructor & Destructor Documentation

TestAndIncr::TestAndIncr ( const Oidx  ) 

virtual TestAndIncr::~TestAndIncr (  )  [virtual]


Member Function Documentation

virtual long TestAndIncr::get_state (  )  [virtual]

virtual void TestAndIncr::set_state ( long   )  [virtual]

virtual int TestAndIncr::set ( const Vbx vb  )  [virtual]

Set the receiver's value and backup its old value for a later undo.

Note:
Override this mehtod in subclasses.
Parameters:
vb - The variable binding that holds the new value.
Returns:
SNMP_ERROR_SUCCESS if the new value has been set, SNMP_ERROR_WRONG_TYPE or SNMP_ERROR_BAD_VALUE otherwise.

Reimplemented from MibLeaf.

virtual boolean TestAndIncr::value_ok ( const Vbx  )  [virtual]

Check whether the receiver's value may be set to the given new value.

Note:
Override this mehtod in subclasses.
Parameters:
v - A new value.
Returns:
TRUE if the new value is valid, otherwise FALSE.

Reimplemented from MibLeaf.

virtual int TestAndIncr::prepare_set_request ( Request ,
int &   
) [virtual]

Let the receiver prepare a SNMP SET subrequest.

Parameters:
req - A pointer to the whole SNMP SET request.
ind - The index of the subrequest to be processed.
Returns:
SNMP_ERROR_SUCCESS on success and SNMP_ERROR_WRONG_VALUE, SNMP_ERROR_WRONG_TYPE, or SNMP_ERROR_NOT_WRITEABLE on failure.

Reimplemented from MibLeaf.

virtual boolean TestAndIncr::is_volatile (  )  [inline, virtual]

Check whether the entry is volatile or not.

Returns:
TRUE if the entry contains volatile data, FALSE otherwise.

Reimplemented from MibEntry.


The documentation for this class was generated from the following file:

Generated on Fri May 29 22:36:56 2009 for AGENT++ by  doxygen 1.5.6