Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MCOid Class Reference

Reference counted oid. More...

#include <mcllib/snmp/MCOid.h>

Inheritance diagram for MCOid:

MCBase List of all members.

Public Types

typedef IMPLTYPE const_iterator
 const iterator type.
typedef const mcuint32IMPLTYPE
 Individual oid component type.
typedef unsigned long size_t
 Size type.

Public Member Functions

const_iterator begin () const
 Iterator to beginning of oid component array.
void clear ()
 clear the contents of the oid
int cmp (const MCOid &mco) const
 oid comparison.
const_iterator end () const
 Iterator to end of oid component array.
unsigned long getCount () const
 debug for getting ref count
bool isPrefixOf (const MCOid &mco) const
 return true if this oid is a prefix of mco
size_t length () const
 Get the number of oid components in the array.
 MCOid (IMPLTYPE pOid, size_t length)
 Construct an oid from a oid component pointer and a length.
 MCOid (const char *oidStr)
 Construct from a string representation of an oid.
 MCOid ()
 Construct an empty oid.
 operator IMPLTYPE () const
 Return a pointer to the beginning of the oid component array.
bool operator!= (const MCOid &mco) const
 Test two oids for inequality.
bool operator< (const MCOid &mco) const
 Test two oids for less-than.
bool operator== (const MCOid &mco) const
 Test two oids for equality.
MCOid suboid (int start, int length=0) const
 get a suboid from the oid
MCString toString () const
 Get a string representation of the oid array.
 ~MCOid ()
 Destroy the oid.

Detailed Description

Reference counted oid.

An oid is an array (or list) of oid components. Each oid component is an integer value (32-bit unsigned integer in this implementation). When expression the oid array as a string, the integer values are separated by the dot (.) character. Example ".1.3.6.1.2.1"


Member Typedef Documentation

typedef IMPLTYPE const_iterator
 

const iterator type.

Note that only constant iterators are provided because the oid data must not be changed via the iterator.


Constructor & Destructor Documentation

MCOid  ) 
 

Construct an empty oid.

No (extra) memory is allocated.

~MCOid  ) 
 

Destroy the oid.

Free any allocated memory

MCOid const char *  oidStr  ) 
 

Construct from a string representation of an oid.

oidStr is either NULL (in which case an empty oid is constructed. See MCOid()) or a list of integers separated by dots. Example ".1.3.6.1.2.1"

MCOid IMPLTYPE  pOid,
size_t  length
 

Construct an oid from a oid component pointer and a length.

pOid points to a oid component array of at least length components. If pOid is NULL or length is zereo an empty oid is constructed (see MCOid()).


Member Function Documentation

int cmp const MCOid mco  )  const
 

oid comparison.

Returns zero if this == mco. Returns a negative number if this < mco. Returns a positive number if this > mco.

operator IMPLTYPE  )  const
 

Return a pointer to the beginning of the oid component array.

If the oid is empty a NULL pointer is returned. Contrast this with MCString cast to const char* which always returns a valid pointer.

bool operator!= const MCOid mco  )  const
 

Test two oids for inequality.

Returns true if this != mco.

bool operator< const MCOid mco  )  const
 

Test two oids for less-than.

Useful for sorting and to allow oids to be used in STL containers. Returns true if this < mco (numerically by component).

bool operator== const MCOid mco  )  const
 

Test two oids for equality.

Returns true if this == mco.


Generated on Wed Jan 12 19:05:51 2005 for MCLLIB by  doxygen 1.3.9.1