Jeff Thompson | c057343 | 2013-09-19 17:41:36 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2013 Regents of the University of California. |
| 4 | * @author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 5 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| 6 | * See COPYING for copyright and distribution information. |
| 7 | */ |
| 8 | |
| 9 | #ifndef NDN_OID_HPP |
Jeff Thompson | e589c3f | 2013-10-12 17:30:50 -0700 | [diff] [blame^] | 10 | #define NDN_OID_HPP |
Jeff Thompson | c057343 | 2013-09-19 17:41:36 -0700 | [diff] [blame] | 11 | |
| 12 | #include <vector> |
| 13 | #include <string> |
| 14 | |
| 15 | namespace ndn { |
| 16 | |
| 17 | class OID { |
| 18 | public: |
| 19 | OID () |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | OID(const std::string& oid); |
| 24 | |
| 25 | OID(const std::vector<int>& oid) |
| 26 | : oid_(oid) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | const std::vector<int> & |
| 31 | getIntegerList() const |
| 32 | { |
| 33 | return oid_; |
| 34 | } |
| 35 | |
| 36 | void |
| 37 | setIntegerList(const std::vector<int>& value){ |
| 38 | oid_ = value; |
| 39 | } |
| 40 | |
| 41 | std::string |
| 42 | toString(); |
| 43 | |
| 44 | bool operator == (const OID& oid) |
| 45 | { |
| 46 | return equal(oid); |
| 47 | } |
| 48 | |
| 49 | bool operator != (const OID& oid) |
| 50 | { |
| 51 | return !equal(oid); |
| 52 | } |
| 53 | |
| 54 | private: |
| 55 | bool equal(const OID& oid); |
| 56 | |
| 57 | std::vector<int> oid_; |
| 58 | }; |
| 59 | |
| 60 | } |
| 61 | |
| 62 | #endif |