AGENT++  4.0.3
Public Member Functions | Protected Attributes | Friends | List of all members
MibGroup Class Reference

#include <mib_context.h>

Inheritance diagram for MibGroup:
MibEntry ThreadManager Synchronized agentpp_simulation_mib simSysGroup snmp_notification_mib snmp_proxy_mib snmp_target_mib snmpGroup sysGroup VacmMIB

Public Member Functions

 MibGroup (const Oidx &)
 Construct a MibGroup with a given OID which has to uniquely identify the group.
 
 MibGroup (const Oidx &, const NS_SNMP OctetStr &)
 Construct a MibGroup with a given OID which has to uniquely identify the group.
 
virtual ~MibGroup ()
 Destructor (does not delete contained MibEntry instances)
 
mib_type type () const
 Return the type of the receiver.
 
MibEntryPtr add (MibEntryPtr item)
 Add a MibEntry object to the receiver group.
 
void remove (const Oidx &)
 Remove a MibEntry object from the receiver group and delete it.
 
ListCursor< MibEntryget_content ()
 Get content.
 
void clearAll ()
 Free content.
 
virtual void load_from_file (const char *)
 Load the value(s) of the receiver node from a file.
 
virtual void save_to_file (const char *)
 Save the value(s) of the receiver node to a file.
 
bool is_persistent ()
 Return whether objects in this group are persistent or not.
 
NS_SNMP OctetStr get_persistency_name ()
 
void set_timeout (unsigned int t)
 Set the timeout value characteristics for this group of MIB objects.
 
unsigned int get_timeout ()
 Get the timeout (in seconds) for this MIB group.
 
- Public Member Functions inherited from MibEntry
 MibEntry ()
 Default constructor.
 
 MibEntry (const Oidx &, mib_access)
 Construct a MibEntry instance with a given object identifier and maximum access rights.
 
 MibEntry (const MibEntry &)
 Copy constructor.
 
virtual ~MibEntry ()
 Destructor.
 
virtual MibEntryclone ()
 Return a clone of the receiver.
 
virtual Oidx find_succ (const Oidx &, Request *req=0)
 Return the successor of a given object identifier within the receiver's scope and the context of a given Request.
 
virtual void get_request (Request *, int)
 Let the receiver process a SNMP GET subrequest.
 
virtual void get_next_request (Request *, int)
 Let the receiver process a SNMP GETNEXT subrequest.
 
virtual int commit_set_request (Request *, int)
 Let the receiver commit a SNMP SET subrequest.
 
virtual int prepare_set_request (Request *, int &)
 Let the receiver prepare a SNMP SET subrequest.
 
virtual int undo_set_request (Request *, int &)
 Clean up resources used for performing (or undoing) set requests.
 
virtual void cleanup_set_request (Request *, int &)
 Set the receiver's value and backup its old value for a later undo.
 
virtual bool serialize (char *&, int &)
 Serialize the value of the receiver.
 
virtual bool deserialize (char *, int &)
 Read the value of the receiver from a byte stream.
 
virtual bool is_empty ()
 Check whether the receiver node contains any instance of a managed object.
 
virtual void notify_change (const Oidx &, mib_change)
 Notify all registered nodes of changes to an object managed by the receiver node.
 
virtual void register_for_notifications (MibEntry *)
 Register an MibEntry object to receive notifications about changes of the receiver node.
 
virtual void add_change_notification (MibEntry *e)
 Wrapper function for register_for_notifications.
 
virtual void change_notification (const Oidx &, mib_change)
 Receive a notification about changes to a managed object.
 
OidxPtr key ()
 Return a pointer to the key (object identifier) of the receiver.
 
virtual OidxPtr max_key ()
 Return the immediate successor of the greatest object identifier within the receiver's scope.
 
virtual mib_access get_access ()
 Return the maximum access rights for the managed object represented by the receiver node.
 
virtual bool is_volatile ()
 Check whether the entry is volatile or not.
 
virtual void reset ()
 Resets (clears) the content of this entry.
 
int operator< (const MibEntry &) const
 
int operator> (const MibEntry &) const
 
int operator== (const MibEntry &) const
 
int operator< (const Oidx &) const
 
int operator> (const Oidx &) const
 
int operator<= (const Oidx &) const
 
int operator>= (const Oidx &) const
 
int operator== (const Oidx &) const
 
- 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

List< MibEntrycontent
 
NS_SNMP OctetStr * persistencyName
 
unsigned int timeout
 
- Protected Attributes inherited from MibEntry
Oidx oid
 
mib_access access
 
List< MibEntrynotifies
 

Friends

class Mib
 

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.
 
- Protected Member Functions inherited from MibEntry
void set_oid (const Oidx &)
 Set the object identifier of the receiver node.
 

Constructor & Destructor Documentation

MibGroup::MibGroup ( const Oidx )

Construct a MibGroup with a given OID which has to uniquely identify the group.

In version < 3.5.15 there was a check that ensured that only objects with an OID in the subtree of the group could have been added to it. This check has been removed because it has no real benefit but some drawbacks.

All objects added to this group will not be persistently stored or loaded.

Parameters
o- The oid of the new MibGroup.
MibGroup::MibGroup ( const Oidx ,
const NS_SNMP OctetStr &   
)

Construct a MibGroup with a given OID which has to uniquely identify the group.

All objects can be stored/loaded to/from persistent storage using the given identification name.

In version < 3.5.15 there was a check that ensured that only objects with an OID in the subtree of the group could have been added to it. This check has been removed because it has no real benefit but some drawbacks.

Whether a particular object is stored/loaded to/from disk depends on the value its is_volatile method returns false.

Parameters
othe oid of the new MibGroup.
persitentNamedetermines under which name the group should be stored persistently.
virtual MibGroup::~MibGroup ( )
virtual

Destructor (does not delete contained MibEntry instances)

Member Function Documentation

MibEntryPtr MibGroup::add ( MibEntryPtr  item)

Add a MibEntry object to the receiver group.

Parameters
itema pointer to the MibEntry instance to be added.
void MibGroup::clearAll ( )

Free content.

Deletes all contained MIB objects and removes them from this group.

Note
Do not call this function after the MibGroup was added to a Mib. If the MibGroup object was not added to a Mib, this function must be called before deleting the object.
ListCursor<MibEntry> MibGroup::get_content ( )

Get content.

Returns
a ListCursor at the first element of the receiver.
NS_SNMP OctetStr MibGroup::get_persistency_name ( )
inline
unsigned int MibGroup::get_timeout ( )
inline

Get the timeout (in seconds) for this MIB group.

Returns
a timeout value in seconds or 0 if default timeout should be used.
Since
3.5
bool MibGroup::is_persistent ( )
inline

Return whether objects in this group are persistent or not.

Returns
TRUE if objects of this group should be stored persistently, FALSE otherwise.
virtual void MibGroup::load_from_file ( const char *  )
virtual

Load the value(s) of the receiver node from a file.

Parameters
fname- A file name.

Reimplemented from MibEntry.

void MibGroup::remove ( const Oidx )

Remove a MibEntry object from the receiver group and delete it.

Note
Do not call this function after the MibGroup was added to a Mib.
Parameters
keythe oid (key) of the MibEntry instance to be removed.
virtual void MibGroup::save_to_file ( const char *  )
virtual

Save the value(s) of the receiver node to a file.

Parameters
fname- A file name.

Reimplemented from MibEntry.

void MibGroup::set_timeout ( unsigned int  t)
inline

Set the timeout value characteristics for this group of MIB objects.

Within AGENT++ this value is currently not used, but AgentX++ is using this value to set the region timeout when registering a subagent. Future implementations may also use this value for setting region (or subtree) timeouts.

Parameters
timeouta timeout value in seconds. 0 sets the systems default timeout.
Since
3.5
mib_type MibGroup::type ( ) const
virtual

Return the type of the receiver.

Returns
GROUP

Reimplemented from MibEntry.

Friends And Related Function Documentation

friend class Mib
friend

Member Data Documentation

List<MibEntry> MibGroup::content
protected
NS_SNMP OctetStr* MibGroup::persistencyName
protected
unsigned int MibGroup::timeout
protected

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