Dangerous SNMP
|
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... | |
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.
NumericOid | ( | const NumericOid & | oid | ) |
Copy constructor; this creates a NumericOid identical to the one given.
oid | The 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.
oidString | The string to parse. |
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.
oidString | The string to parse. |
ParseErrorException |
bool beginsWith | ( | const NumericOid & | oid | ) | const |
This checks to see if this OID begins with the exact sequence of the OID given.
oid | The comparison OID. |
bool equals | ( | const NumericOid & | oid | ) | const |
This compares this NumericOid to another one.
If they are equal, then this returns true.
oid | The comparison OID. |
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.
oid | The comparison OID. |
std::string str | ( | ) | const |
This returns a string representing the OID.
std::vector<unsigned int> numbers |
This is the vector that represents the integers that make up the OID.