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
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
i
l
m
n
o
p
q
r
s
t
u
v
Enumerations
+
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
w
+
Typedefs
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
+
Enumerator
a
d
e
f
g
i
k
l
m
n
p
r
s
u
w
+
Related Functions
b
c
d
f
i
k
l
n
o
p
s
+
Files
File List
+
File Members
+
All
a
b
c
d
e
f
g
h
k
l
m
n
p
r
s
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
g
k
l
n
p
r
s
Typedefs
+
Macros
b
d
e
l
m
n
p
r
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
in-memory-storage-fifo.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
in-memory-storage-fifo.hpp
"
23
24
namespace
ndn
{
25
namespace
util {
26
27
InMemoryStorageFifo::InMemoryStorageFifo
(
size_t
limit)
28
:
InMemoryStorage
(limit)
29
{
30
}
31
32
InMemoryStorageFifo::InMemoryStorageFifo
(boost::asio::io_service& ioService,
size_t
limit)
33
:
InMemoryStorage
(ioService, limit)
34
{
35
}
36
37
InMemoryStorageFifo::~InMemoryStorageFifo
()
38
{
39
}
40
41
void
42
InMemoryStorageFifo::afterInsert
(
InMemoryStorageEntry
* entry)
43
{
44
BOOST_ASSERT(m_cleanupIndex.size() <=
size
());
45
m_cleanupIndex.insert(entry);
46
}
47
48
bool
49
InMemoryStorageFifo::evictItem
()
50
{
51
if
(!m_cleanupIndex.get<byArrival>().empty()) {
52
CleanupIndex::index<byArrival>::type::iterator
it = m_cleanupIndex.get<byArrival>().
begin
();
53
eraseImpl
((*it)->getFullName());
54
m_cleanupIndex.get<byArrival>().
erase
(it);
55
return
true
;
56
}
57
58
return
false
;
59
}
60
61
void
62
InMemoryStorageFifo::beforeErase
(
InMemoryStorageEntry
* entry)
63
{
64
CleanupIndex::index<byEntity>::type::iterator
it = m_cleanupIndex.get<byEntity>().
find
(entry);
65
if
(it != m_cleanupIndex.get<byEntity>().end())
66
m_cleanupIndex.get<byEntity>().erase(it);
67
}
68
69
}
// namespace util
70
}
// namespace ndn
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::util::InMemoryStorage::find
shared_ptr< const Data > find(const Interest &interest)
Finds the best match Data for an Interest.
Definition:
in-memory-storage.cpp:226
ndn::util::InMemoryStorage::size
size_t size() const
Definition:
in-memory-storage.hpp:197
ndn::util::InMemoryStorageFifo::InMemoryStorageFifo
InMemoryStorageFifo(size_t limit=10)
Definition:
in-memory-storage-fifo.cpp:27
ndn::util::InMemoryStorage::evictItem
virtual bool evictItem()=0
Removes one Data packet from in-memory storage based on derived class implemented replacement policy...
in-memory-storage-fifo.hpp
ndn::util::InMemoryStorage::eraseImpl
void eraseImpl(const Name &name)
deletes in-memory storage entries by the Name with implicit digest.
Definition:
in-memory-storage.cpp:404
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
ndn::util::InMemoryStorage::begin
InMemoryStorage::const_iterator begin() const
Returns begin iterator of the in-memory storage ordering by name with digest.
Definition:
in-memory-storage.cpp:415
ndn::util::InMemoryStorage
Represents in-memory storage.
Definition:
in-memory-storage.hpp:46
ndn::util::InMemoryStorageEntry
Represents an in-memory storage entry.
Definition:
in-memory-storage-entry.hpp:35
ndn::util::InMemoryStorageFifo::~InMemoryStorageFifo
virtual ~InMemoryStorageFifo()
Definition:
in-memory-storage-fifo.cpp:37
ndn::util::InMemoryStorageFifo::afterInsert
virtual void afterInsert(InMemoryStorageEntry *entry)
Update the entry after a entry is successfully inserted, add it to the cleanupIndex.
Definition:
in-memory-storage-fifo.cpp:42
ndn::util::InMemoryStorageFifo::beforeErase
virtual void beforeErase(InMemoryStorageEntry *entry)
Update the entry or other data structures before a entry is successfully erased, erase it from the cl...
Definition:
in-memory-storage-fifo.cpp:62
ndn::util::InMemoryStorage::erase
void erase(const Name &prefix, const bool isPrefix=true)
Deletes in-memory storage entry by prefix by default.
Definition:
in-memory-storage.cpp:377
ndnSIM
ndn-cxx
src
util
in-memory-storage-fifo.cpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12