]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/other/smux/types.h
Other comparsion functions for OID added
[stg.git] / projects / stargazer / plugins / other / smux / types.h
1 #ifndef __TYPES_H__
2 #define __TYPES_H__
3
4 #include <string>
5 #include <vector>
6 #include <istream>
7
8 #include "asn1/OBJECT_IDENTIFIER.h"
9
10 class OID {
11     public:
12         OID(const std::string & str);
13         OID(const char * str, size_t length);
14         OID(const std::vector<unsigned> & arcs);
15         OID(const unsigned * arcs, size_t length);
16         OID(OBJECT_IDENTIFIER_t * oid);
17         OID(const OID & rvalue);
18         ~OID();
19
20         std::string ToString() const;
21         const std::vector<unsigned> & ToVector() const { return arcs; }
22         void ToOID(OBJECT_IDENTIFIER_t * oid) const;
23
24         OID & operator=(const OID & rvalue);
25         bool operator==(const OID & rvalue) const;
26         bool operator!=(const OID & rvalue) const { return !operator==(rvalue); }
27         bool operator<(const OID & rvalue) const;
28         bool operator>(const OID & rvalue) const
29         { return !operator==(rvalue) && !operator<(rvalue); }
30
31         friend std::ostream & operator<<(std::ostream & stream, const OID & oid);
32
33     private:
34         std::vector<unsigned> arcs;
35 };
36
37 #endif