oid.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_OID_HPP
24 #define NDN_OID_HPP
25 
26 #include <vector>
27 #include <string>
28 
29 namespace ndn {
30 
31 class OID {
32 public:
33  OID ()
34  {
35  }
36 
37  OID(const std::string& oid);
38 
39  OID(const std::vector<int>& oid)
40  : oid_(oid)
41  {
42  }
43 
44  OID(const int* integerList, size_t integerListLength)
45  {
46  setIntegerList(integerList, integerListLength);
47  }
48 
49  const std::vector<int> &
50  getIntegerList() const
51  {
52  return oid_;
53  }
54 
55  void
56  setIntegerList(const std::vector<int>& value)
57  {
58  oid_ = value;
59  }
60 
61  void
62  setIntegerList(const int* value, size_t valueLength);
63 
64  std::string
65  toString() const;
66 
67  bool operator == (const OID& oid) const
68  {
69  return equal(oid);
70  }
71 
72  bool operator != (const OID& oid) const
73  {
74  return !equal(oid);
75  }
76 
77 private:
78  bool equal(const OID& oid) const;
79 
80  std::vector<int> oid_;
81 };
82 
83 }
84 
85 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
Definition: oid.hpp:31