NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
cs-entry.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_TABLE_CS_ENTRY_HPP
27
#define NFD_DAEMON_TABLE_CS_ENTRY_HPP
28
29
#include "common.hpp"
30
31
namespace
nfd
{
32
namespace
cs {
33
36
class
Entry
37
{
38
public
:
// exposed through ContentStore enumeration
42
const
Data
&
43
getData
()
const
44
{
45
BOOST_ASSERT(this->
hasData
());
46
return
*m_data;
47
}
48
52
const
Name
&
53
getName
()
const
54
{
55
BOOST_ASSERT(this->
hasData
());
56
return
m_data->getName();
57
}
58
62
const
Name
&
63
getFullName
()
const
64
{
65
BOOST_ASSERT(this->
hasData
());
66
return
m_data->getFullName();
67
}
68
72
bool
73
isUnsolicited
()
const
74
{
75
BOOST_ASSERT(this->
hasData
());
76
return
m_isUnsolicited;
77
}
78
83
const
time::steady_clock::TimePoint
&
84
getStaleTime
()
const
85
{
86
BOOST_ASSERT(this->
hasData
());
87
return
m_staleTime;
88
}
89
93
bool
94
isStale
()
const
;
95
100
bool
101
canSatisfy
(
const
Interest
& interest)
const
;
102
103
public
:
// used by generic ContentStore implementation
106
bool
107
hasData
()
const
108
{
109
return
m_data !=
nullptr
;
110
}
111
114
void
115
setData
(shared_ptr<const Data> data,
bool
isUnsolicited
);
116
119
void
120
setData
(
const
Data
& data,
bool
isUnsolicited)
121
{
122
this->
setData
(data.shared_from_this(),
isUnsolicited
);
123
}
124
127
void
128
updateStaleTime
();
129
133
void
134
reset
();
135
136
private
:
137
shared_ptr<const Data> m_data;
138
bool
m_isUnsolicited;
139
time::steady_clock::TimePoint
m_staleTime;
140
};
141
142
}
// namespace cs
143
}
// namespace nfd
144
145
#endif // NFD_DAEMON_TABLE_CS_ENTRY_HPP
nfd::cs::Entry::reset
void reset()
clears the entry
Definition:
cs-entry.cpp:75
ndn::time::steady_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:108
nfd::cs::Entry::hasData
bool hasData() const
Definition:
cs-entry.hpp:107
nfd::cs::Entry::canSatisfy
bool canSatisfy(const Interest &interest) const
determines whether Interest can be satisified by the stored Data
Definition:
cs-entry.cpp:60
nfd::cs::Entry::isStale
bool isStale() const
checks if the stored Data is stale now
Definition:
cs-entry.cpp:41
nfd::cs::Entry::setData
void setData(shared_ptr< const Data > data, bool isUnsolicited)
replaces the stored Data
Definition:
cs-entry.cpp:32
nfd::cs::Entry::getFullName
const Name & getFullName() const
Definition:
cs-entry.hpp:63
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:45
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::cs::Entry::setData
void setData(const Data &data, bool isUnsolicited)
replaces the stored Data
Definition:
cs-entry.hpp:120
nfd::cs::Entry::getData
const Data & getData() const
Definition:
cs-entry.hpp:43
nfd::cs::Entry
represents a base class for CS entry
Definition:
cs-entry.hpp:36
nfd::cs::Entry::isUnsolicited
bool isUnsolicited() const
Definition:
cs-entry.hpp:73
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
nfd::cs::Entry::updateStaleTime
void updateStaleTime()
refreshes stale time relative to current time
Definition:
cs-entry.cpp:48
nfd::cs::Entry::getName
const Name & getName() const
Definition:
cs-entry.hpp:53
ndn::Data
represents a Data packet
Definition:
data.hpp:39
nfd::cs::Entry::getStaleTime
const time::steady_clock::TimePoint & getStaleTime() const
Definition:
cs-entry.hpp:84
ndnSIM
NFD
daemon
table
cs-entry.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11