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
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
cs-entry.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
30
#include "
cs-entry.hpp
"
31
#include "
core/logger.hpp
"
32
33
namespace
nfd {
34
namespace
cs {
35
36
NFD_LOG_INIT
(
"CsEntry"
);
37
38
Entry::Entry
()
39
: m_isUnsolicited(false)
40
{
41
}
42
43
void
44
Entry::setData
(
const
Data& data,
bool
isUnsolicited)
45
{
46
m_isUnsolicited =
isUnsolicited
;
47
m_dataPacket = data.shared_from_this();
48
49
updateStaleTime
();
50
}
51
52
void
53
Entry::updateStaleTime
()
54
{
55
m_staleAt = time::steady_clock::now() + m_dataPacket->getFreshnessPeriod();
56
}
57
58
bool
59
Entry::isStale
()
const
60
{
61
return
m_staleAt < time::steady_clock::now();
62
}
63
64
void
65
Entry::reset
()
66
{
67
m_staleAt = time::steady_clock::TimePoint();
68
m_dataPacket.reset();
69
m_isUnsolicited =
false
;
70
}
71
72
}
// namespace cs
73
}
// namespace nfd
nfd::cs::Entry::reset
void reset()
clears CS entry After reset, *this == Entry()
Definition:
cs-entry.cpp:65
nfd::cs::Entry::isStale
bool isStale() const
checks if the stored Data is stale
Definition:
cs-entry.cpp:59
logger.hpp
nfd::cs::Entry::setData
void setData(const Data &data, bool isUnsolicited)
changes the content of CS entry and recomputes digest
Definition:
cs-entry.cpp:44
cs-entry.hpp
nfd::cs::Entry::isUnsolicited
bool isUnsolicited() const
Data packet is unsolicited if this particular NDN node did not receive an Interest packet for it...
Definition:
cs-entry.hpp:129
nfd::cs::Entry::updateStaleTime
void updateStaleTime()
refreshes the time when Data becomes expired according to the current absolute time.
Definition:
cs-entry.cpp:53
NFD_LOG_INIT
#define NFD_LOG_INIT(name)
Definition:
logger.hpp:33
nfd::cs::Entry::Entry
Entry()
Definition:
cs-entry.cpp:38
ndnSIM
NFD
daemon
table
cs-entry.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7