blob: f21788985f07be6009e9d9bd8fe8b2ea016a47e3 [file] [log] [blame]
Jeff Thompsonc0573432013-09-19 17:41:36 -07001/* -*- 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 Thompsone589c3f2013-10-12 17:30:50 -070010#define NDN_OID_HPP
Jeff Thompsonc0573432013-09-19 17:41:36 -070011
12#include <vector>
13#include <string>
14
15namespace ndn {
16
17class OID {
18public:
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
Jeff Thompson6c729a22013-12-20 10:37:59 -080042 toString() const;
Jeff Thompsonc0573432013-09-19 17:41:36 -070043
Jeff Thompson6c729a22013-12-20 10:37:59 -080044 bool operator == (const OID& oid) const
Jeff Thompsonc0573432013-09-19 17:41:36 -070045 {
46 return equal(oid);
47 }
48
Jeff Thompson6c729a22013-12-20 10:37:59 -080049 bool operator != (const OID& oid) const
Jeff Thompsonc0573432013-09-19 17:41:36 -070050 {
51 return !equal(oid);
52 }
53
54private:
Jeff Thompson6c729a22013-12-20 10:37:59 -080055 bool equal(const OID& oid) const;
Jeff Thompsonc0573432013-09-19 17:41:36 -070056
57 std::vector<int> oid_;
58};
59
60}
61
62#endif