NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
in-memory-storage-entry.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2021 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_CXX_IMS_IN_MEMORY_STORAGE_ENTRY_HPP
23
#define NDN_CXX_IMS_IN_MEMORY_STORAGE_ENTRY_HPP
24
25
#include "
ndn-cxx/data.hpp
"
26
#include "
ndn-cxx/interest.hpp
"
27
#include "
ndn-cxx/util/scheduler.hpp
"
28
29
namespace
ndn
{
30
33
class
InMemoryStorageEntry
: noncopyable
34
{
35
public
:
38
InMemoryStorageEntry
();
39
42
void
43
release
();
44
47
const
Name
&
48
getName
()
const
49
{
50
return
m_dataPacket->getName();
51
}
52
56
const
Name
&
57
getFullName
()
const
58
{
59
return
m_dataPacket->getFullName();
60
}
61
64
const
Data
&
65
getData
()
const
66
{
67
return
*m_dataPacket;
68
}
69
74
void
75
setData
(
const
Data
& data);
76
79
void
80
scheduleMarkStale
(
Scheduler
& sched,
time::nanoseconds
after);
81
84
bool
85
isFresh
()
86
{
87
return
m_isFresh;
88
}
89
90
private
:
91
shared_ptr<const Data> m_dataPacket;
92
93
bool
m_isFresh;
94
scheduler::ScopedEventId
m_markStaleEventId;
95
};
96
97
}
// namespace ndn
98
99
#endif // NDN_CXX_IMS_IN_MEMORY_STORAGE_ENTRY_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::InMemoryStorageEntry::getFullName
const Name & getFullName() const
Returns the full name (including implicit digest) of the Data packet stored in the in-memory storage ...
Definition:
in-memory-storage-entry.hpp:57
ndn::InMemoryStorageEntry::getName
const Name & getName() const
Returns the name of the Data packet stored in the in-memory storage entry.
Definition:
in-memory-storage-entry.hpp:48
ndn::InMemoryStorageEntry::setData
void setData(const Data &data)
Changes the content of in-memory storage entry.
Definition:
in-memory-storage-entry.cpp:39
scheduler.hpp
data.hpp
ndn::InMemoryStorageEntry::getData
const Data & getData() const
Returns the Data packet stored in the in-memory storage entry.
Definition:
in-memory-storage-entry.hpp:65
ndn::InMemoryStorageEntry::isFresh
bool isFresh()
Check if the data can satisfy an interest with MustBeFresh.
Definition:
in-memory-storage-entry.hpp:85
interest.hpp
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::InMemoryStorageEntry
Represents an in-memory storage entry.
Definition:
in-memory-storage-entry.hpp:33
ndn::scheduler::Scheduler
Generic time-based scheduler.
Definition:
scheduler.hpp:132
ndn::InMemoryStorageEntry::scheduleMarkStale
void scheduleMarkStale(Scheduler &sched, time::nanoseconds after)
Schedule an event to mark this entry as non-fresh.
Definition:
in-memory-storage-entry.cpp:46
ndn::Data
Represents a Data packet.
Definition:
data.hpp:37
ndn::InMemoryStorageEntry::InMemoryStorageEntry
InMemoryStorageEntry()
Create an entry.
Definition:
in-memory-storage-entry.cpp:26
ndn::InMemoryStorageEntry::release
void release()
Releases reference counts on shared objects.
Definition:
in-memory-storage-entry.cpp:32
ndn::time::nanoseconds
boost::chrono::nanoseconds nanoseconds
Definition:
time.hpp:50
ndn::detail::ScopedCancelHandle< EventId >
ndnSIM
ndn-cxx
ndn-cxx
ims
in-memory-storage-entry.hpp
Generated on Fri May 6 2022 12:34:12 for ndnSIM by
1.8.13