Dangerous SNMP
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
NumericOid Class Reference

A NumericOid represents an "true" OID; that is, one identified by a series of integers (as opposed to a named OID). More...

#include <numericoid.hpp>

Public Member Functions

 NumericOid ()
 Constructor; this creates a NumericOid with no integers.
 
 NumericOid (const NumericOid &oid)
 Copy constructor; this creates a NumericOid identical to the one given. More...
 
 NumericOid (const std::string &oidString) throw ( ParseErrorException )
 String constructor; this creates a NumericOid representing the text that was given. More...
 
 NumericOid (const char *oidString) throw ( ParseErrorException )
 C-string constructor; this creates a NumericOid representing the text that was given. More...
 
bool equals (const NumericOid &oid) const
 This compares this NumericOid to another one. More...
 
bool isLessThan (const NumericOid &oid) const
 This compares this NumericOid to another one. More...
 
bool beginsWith (const NumericOid &oid) const
 This checks to see if this OID begins with the exact sequence of the OID given. More...
 
std::string str () const
 This returns a string representing the OID. More...
 

Public Attributes

std::vector< unsigned int > numbers
 This is the vector that represents the integers that make up the OID. More...
 

Detailed Description

A NumericOid represents an "true" OID; that is, one identified by a series of integers (as opposed to a named OID).

Note that a "proper" OID has certain restrictions on what is legal for the first two integers; however, we will not be enforcing that here because of the use cases of partial OIDs. Any quality enforcement will be done on the part of the encoders and decoders.

An OID respects the concept of "lexicographic" sorting; that is, it can be said that one OID comes before another, and all will agree to this statement. Thus, OIDs can be sorted.

Constructor & Destructor Documentation

NumericOid ( const NumericOid oid)

Copy constructor; this creates a NumericOid identical to the one given.

Parameters
oidThe NumericOid to copy.
NumericOid ( const std::string &  oidString)
throw (ParseErrorException
)

String constructor; this creates a NumericOid representing the text that was given.

In the event that the text does not represent a numeric OID, this will throw a ParseErrorException.

Parameters
oidStringThe string to parse.
Exceptions
ParseErrorException
NumericOid ( const char *  oidString)
throw (ParseErrorException
)

C-string constructor; this creates a NumericOid representing the text that was given.

In the event that the text does not represent a numeric OID, this will throw a ParseErrorException.

Parameters
oidStringThe string to parse.
Exceptions
ParseErrorException

Member Function Documentation

bool beginsWith ( const NumericOid oid) const

This checks to see if this OID begins with the exact sequence of the OID given.

Parameters
oidThe comparison OID.
Returns
true if this one begins with the OID given; false otherwise.
bool equals ( const NumericOid oid) const

This compares this NumericOid to another one.

If they are equal, then this returns true.

Parameters
oidThe comparison OID.
Returns
true if they are equal; false otherwise.
bool isLessThan ( const NumericOid oid) const

This compares this NumericOid to another one.

If this one is less than the other one, then this returns true.

Parameters
oidThe comparison OID.
Returns
true if this one is smaller; false otherwise.
std::string str ( ) const

This returns a string representing the OID.

Returns
A string that can be used to represent the OID.

Member Data Documentation

std::vector<unsigned int> numbers

This is the vector that represents the integers that make up the OID.


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