#include <mib_context.h>
Public Member Functions | |
MibContext () | |
Default constructor. | |
MibContext (const NS_SNMP OctetStr &) | |
Create a given context. | |
virtual | ~MibContext () |
Destructor. | |
virtual boolean | init_from (const NS_SNMP OctetStr &) |
Initialize context, thus load initialize groups with data from persistent storage. | |
virtual boolean | load_from (const NS_SNMP OctetStr &) |
Loads persistent data from the supplied path. | |
virtual boolean | 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 boolean | 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. | |
Protected Attributes | |
OidList< MibEntry > | content |
OidList< MibGroup > | groups |
Oidx | contextKey |
NS_SNMP OctetStr | context |
NS_SNMP OctetStr * | persistencyPath |
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 MibContext::~MibContext | ( | ) | [virtual] |
Destructor.
virtual boolean MibContext::init_from | ( | const NS_SNMP OctetStr & | ) | [virtual] |
Initialize context, thus load initialize groups with data from persistent storage.
path | where data should be loaded from. |
virtual boolean MibContext::load_from | ( | const NS_SNMP OctetStr & | ) | [virtual] |
Loads persistent data from the supplied path.
Any previously existing data will be deleted before loading.
path | where data should be loaded from. |
virtual boolean MibContext::save_to | ( | const NS_SNMP OctetStr & | ) | [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. |
OidxPtr MibContext::key | ( | ) |
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. |
Get the MIB object with a given object id.
key | an object identifier |
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 |
virtual int MibContext::find | ( | const Oidx & | , | |
MibEntryPtr & | ||||
) | [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. |
virtual int MibContext::find_lower | ( | const Oidx & | , | |
MibEntryPtr & | ||||
) | [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 int MibContext::find_upper | ( | const Oidx & | , | |
MibEntryPtr & | ||||
) | [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. |
OidListCursor<MibEntry> MibContext::get_content | ( | ) |
OidListCursor<MibGroup> MibContext::get_groups | ( | ) |
Find a group with a given OID.
(NOT SYNCHRONIZED)
oid | a group's oid. |
virtual boolean MibContext::remove_group | ( | const Oidx & | ) | [virtual] |
Remove a group and all its entries from the context.
(SYNCHRONIZED)
oid | a group's oid. |
NS_SNMP OctetStr MibContext::get_name | ( | ) | [inline] |
Get the name of the context.
unsigned int MibContext::get_num_groups | ( | ) | const [inline] |
Get the number of MibGroup instances in this context.
MibGroup* MibContext::get_group | ( | int | n | ) | [inline] |
unsigned int MibContext::get_num_entries | ( | ) | const [inline] |
Get the number of entries in this context.
OidList<MibEntry> MibContext::content [protected] |
OidList<MibGroup> MibContext::groups [protected] |
Oidx MibContext::contextKey [protected] |
NS_SNMP OctetStr MibContext::context [protected] |
NS_SNMP OctetStr* MibContext::persistencyPath [protected] |