AGENT++
4.0.3
|
#include <mib_context.h>
Public Member Functions | |
MibContext () | |
Default constructor. | |
MibContext (const NS_SNMP OctetStr &) | |
Create a given context. | |
virtual | ~MibContext () |
Destructor. | |
virtual bool | init_from (const NS_SNMP OctetStr &) |
Initialize context, thus load initialize groups with data from persistent storage. | |
virtual bool | load_from (const NS_SNMP OctetStr &) |
Loads persistent data from the supplied path. | |
virtual bool | save_to (const NS_SNMP OctetStr &) |
Save management data to persistent storage. | |
OidxPtr | key () |
Return a key value for the receiver context. | |
virtual MibEntry * | add (MibEntry *) |
Register a MIB object for the context. | |
virtual MibEntry * | remove (const Oidx &) |
Unregister a MIB object from the context. | |
virtual MibEntry * | get (const Oidx &) |
Get the MIB object with a given object id. | |
virtual MibEntry * | seek (const Oidx &) |
Get the MIB entry with a given object id if such an entry exists or otherwise an object near to the given oid. | |
virtual int | find (const Oidx &, MibEntryPtr &) |
Find a MIB entry with a given oid. | |
virtual int | find_lower (const Oidx &, MibEntryPtr &) |
Find a MIB entry with an oid less or equal to a given oid. | |
virtual int | find_upper (const Oidx &, MibEntryPtr &) |
Find a MIB entry with an oid greater or equal to a given oid. | |
virtual MibEntry * | find_next (const Oidx &) |
Find the successor of a given MibEntry. | |
OidListCursor< MibEntry > | get_content () |
Get a OidListCursor at the first element of the receiver. | |
OidListCursor< MibGroup > | get_groups () |
Get a Cursor at the first element of registered groups. | |
virtual MibGroup * | find_group (const Oidx &) |
Find a group with a given OID. | |
virtual bool | remove_group (const Oidx &) |
Remove a group and all its entries from the context. | |
virtual MibGroup * | find_group_of (const Oidx &) |
Find the MibGroup that contains a MibEntry with a given object ID. | |
NS_SNMP OctetStr | get_name () |
Get the name of the context. | |
unsigned int | get_num_groups () const |
Get the number of MibGroup instances in this context. | |
MibGroup * | get_group (int n) |
Get the nth group of the MibGroup instances in this context. | |
unsigned int | get_num_entries () const |
Get the number of entries in this context. | |
Public Member Functions inherited from ThreadManager | |
ThreadManager () | |
Default constructor. | |
virtual | ~ThreadManager () |
Destructor. | |
void | start_synch () |
Start synchronized execution. | |
void | end_synch () |
End synchronized execution. | |
Public Member Functions inherited from Synchronized | |
Synchronized () | |
~Synchronized () | |
void | wait () |
Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. | |
bool | wait (unsigned long timeout) |
Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. | |
void | notify () |
Wakes up a single thread that is waiting on this object's monitor. | |
void | notify_all () |
Wakes up all threads that are waiting on this object's monitor. | |
bool | lock () |
Enter a critical section. | |
TryLockResult | trylock () |
Try to enter a critical section. | |
bool | unlock () |
Leave a critical section. | |
Protected Attributes | |
OidList< MibEntry > | content |
OidList< MibGroup > | groups |
Oidx | contextKey |
NS_SNMP OctetStr | context |
NS_SNMP OctetStr * | persistencyPath |
Additional Inherited Members | |
Public Types inherited from Synchronized | |
enum | TryLockResult { LOCKED = 1, BUSY = 0, OWNED = -1 } |
Static Public Member Functions inherited from ThreadManager | |
static void | start_global_synch () |
Start global synchronized execution. | |
static void | end_global_synch () |
End global synchronized execution. | |
MibContext::MibContext | ( | ) |
Default constructor.
Creates a default context.
MibContext::MibContext | ( | const NS_SNMP OctetStr & | ) |
Create a given context.
context | an OctetStr instance identifying the context to be created. |
|
virtual |
Destructor.
|
virtual |
Find a MIB entry with a given oid.
oid | an object identifier. |
entry | changed to a pointer to the found entry or unchanged if the return value is different from SNMP_ERROR_SUCCESS. |
Find a group with a given OID.
(NOT SYNCHRONIZED)
oid | a group's oid. |
|
virtual |
Find a MIB entry with an oid less or equal to a given oid.
oid | an object identifier. |
entry | changed to a pointer to the found entry or unchanged if the return value is different from SNMP_ERROR_SUCCESS. |
|
virtual |
Find a MIB entry with an oid greater or equal to a given oid.
oid | an object identifier. |
entry | changed to a pointer to the found entry or unchanged if the return value is different from SNMP_ERROR_SUCCESS. |
Get the MIB object with a given object id.
key | an object identifier |
OidListCursor<MibEntry> MibContext::get_content | ( | ) |
Get a OidListCursor at the first element of the receiver.
|
inline |
OidListCursor<MibGroup> MibContext::get_groups | ( | ) |
Get a Cursor at the first element of registered groups.
|
inline |
Get the name of the context.
|
inline |
Get the number of entries in this context.
|
inline |
Get the number of MibGroup instances in this context.
|
virtual |
Initialize context, thus load initialize groups with data from persistent storage.
path | where data should be loaded from. |
OidxPtr MibContext::key | ( | ) |
Return a key value for the receiver context.
|
virtual |
Loads persistent data from the supplied path.
Any previously existing data will be deleted before loading.
path | where data should be loaded from. |
Unregister a MIB object from the context.
This method does not work for MibGroups, instead you have to remove each MibGroup's MIB object seperately. (SYNCHRONIZED)
oid | the oid of the object to be removed. |
|
virtual |
Remove a group and all its entries from the context.
(SYNCHRONIZED)
oid | a group's oid. |
|
virtual |
Save management data to persistent storage.
NOTE: This method is called by the receiver's destructor with the path used by init_from.
path | where data should be written to. |
Get the MIB entry with a given object id if such an entry exists or otherwise an object near to the given oid.
key | an object identifier |
|
protected |
|
protected |
|
protected |