All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
oid.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
9 #ifndef NDN_OID_HPP
10 #define NDN_OID_HPP
11 
12 #include "../common.hpp"
13 
14 namespace CryptoPP {
15 class BufferedTransformation;
16 }
17 
18 namespace ndn {
19 
20 class OID
21 {
22 public:
23  OID ()
24  {
25  }
26 
27  OID(const char* oid);
28 
29  OID(const std::string& oid);
30 
31  OID(const std::vector<int>& oid)
32  : m_oid(oid)
33  {
34  }
35 
36  const std::vector<int>&
38  {
39  return m_oid;
40  }
41 
42  void
43  setIntegerList(const std::vector<int>& value){
44  m_oid = value;
45  }
46 
47  std::string
48  toString() const;
49 
50  bool operator == (const OID& oid) const
51  {
52  return equal(oid);
53  }
54 
55  bool operator != (const OID& oid) const
56  {
57  return !equal(oid);
58  }
59 
60  void
61  encode(CryptoPP::BufferedTransformation& out) const;
62 
63  void
64  decode(CryptoPP::BufferedTransformation& in);
65 
66 
67 private:
68  void
69  construct(const std::string& value);
70 
71  bool
72  equal(const OID& oid) const;
73 
74 private:
75  std::vector<int> m_oid;
76 };
77 
78 }
79 
80 #endif
bool operator!=(const OID &oid) const
Definition: oid.hpp:55
std::string toString() const
Definition: oid.cpp:50
OID()
Definition: oid.hpp:23
void setIntegerList(const std::vector< int > &value)
Definition: oid.hpp:43
const std::vector< int > & getIntegerList() const
Definition: oid.hpp:37
void decode(CryptoPP::BufferedTransformation &in)
Definition: oid.cpp:124
OID(const std::vector< int > &oid)
Definition: oid.hpp:31
Definition: oid.hpp:20
bool operator==(const OID &oid) const
Definition: oid.hpp:50
void encode(CryptoPP::BufferedTransformation &out) const
Definition: oid.cpp:109