blob: d6de294880c22f9627fe13059bd7d29a402cc9d6 [file] [log] [blame]
shockjiange9c1ab92014-07-21 12:02:52 -07001/*
2 * RR.h
3 *
4 * Created on: 18 Jul, 2014
5 * Author: shock
6 */
7
8#ifndef RR_H_
9#define RR_H_
10
11#include <string>
12
13
14#include "ndns-tlv.h"
15#include <ndn-cxx/encoding/block.hpp>
16#include <ndn-cxx/interest.hpp>
17
18
19using namespace std;
20
21namespace ndn {
22
23enum RRType
24{
25 NS,
26 TXT,
27 UNKNOWN
28};
29
30
31
32
33class RR {
34public:
35 RR();
36 virtual ~RR();
37
38 const string& getRrdata() const {
39 return m_rrData;
40 }
41
42 void setRrdata(const string& rrdata) {
43 this->m_rrData = rrdata;
44 }
45
46
47
48private:
49template<bool T>
50size_t
51wireEncode(EncodingImpl<T> & block) const;
52
53public:
54
55const Block&
56wireEncode() const;
57
58void
59wireDecode(const Block& wire);
60
61
62Interest
63toWire() const;
64
65
66private:
67 unsigned long id;
68 string m_rrData;
69
70 mutable Block m_wire;
71};
72
73} /* namespace ndn */
74
75#endif /* RR_H_ */