blob: fd1db18d74541c9c35960e0bdb250d4b4ef61703 [file] [log] [blame]
Zhenkai Zhu9bad2bf2012-12-28 15:31:46 -08001#ifndef CCNX_INTEREST_H
2#define CCNX_INTEREST_H
3#include "ccnx-common.h"
4
5namespace Ccnx {
6
7// Currently, other classes use string when Interest is needed.
8// The constructor from string ensures that if we change other classes' APIs to use Interest object
9// instead of string, it is still backwards compatible
10// Using a separate Interest class instead of simple string allows us to add control fields
11// to the Interest, e.g. ChildSelector. Perhaps that's a separate Selectors class. Will do it after ChronoShare project finishes.
12
13// Since the selector is only useful when sending Interest (in callbacks, usually we only need to know the name of the Interest),
14// we currently only use Interest object in sendInterest of CcnxWrapper. In other places, Interest object is equivalent of
15// its string name.
16
17class Interest
18{
19public:
20 Interest(const string &name) : m_name(name) {}
21 virtual ~Interest() {}
22
23 string
24 name() const { return m_name; }
25
26protected:
27 string m_name;
28};
29
30} // Ccnx
31#endif