Dangerous SNMP
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
numericoid.hpp
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include "exception.hpp"
7 
8 namespace dangerous { namespace snmp {
9 
22 class NumericOid {
23 public:
28 
33  NumericOid( const NumericOid& oid );
34 
42  NumericOid( const std::string& oidString ) throw( ParseErrorException );
43 
51  NumericOid( const char* oidString ) throw( ParseErrorException );
52 
53 //protected: //< TODO: MAKE THIS PROTECTED AGAIN?
54 public:
57  std::vector<unsigned int> numbers;
58 
59 public:
66  bool equals( const NumericOid& oid ) const;
67 
75  bool isLessThan( const NumericOid& oid ) const;
76 
83  bool beginsWith( const NumericOid& oid ) const;
84 
89  std::string str() const;
90 };
91 
92 static inline bool operator<( const NumericOid& left, const NumericOid& right ) {
93  return left.isLessThan( right );
94 }
95 
96 } }
97 
bool isLessThan(const NumericOid &oid) const
This compares this NumericOid to another one.
bool beginsWith(const NumericOid &oid) const
This checks to see if this OID begins with the exact sequence of the OID given.
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.
Definition: numericoid.hpp:57
bool equals(const NumericOid &oid) const
This compares this NumericOid to another one.
A NumericOid represents an "true" OID; that is, one identified by a series of integers (as opposed to...
Definition: numericoid.hpp:22
NumericOid()
Constructor; this creates a NumericOid with no integers.
Definition: numericoid.hpp:27
This represents a parse-error event.
Definition: exception.hpp:135