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.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_UTIL_IN_MEMORY_STORAGE_FIFO_HPP
23
#define NDN_UTIL_IN_MEMORY_STORAGE_FIFO_HPP
24
25
#include "
in-memory-storage.hpp
"
26
27
#include <boost/multi_index_container.hpp>
28
#include <boost/multi_index/sequenced_index.hpp>
29
#include <boost/multi_index/hashed_index.hpp>
30
31
namespace
ndn
{
32
namespace
util {
33
37
class
InMemoryStorageFifo
:
public
InMemoryStorage
38
{
39
public
:
40
explicit
41
InMemoryStorageFifo
(
size_t
limit = 10);
42
43
explicit
44
InMemoryStorageFifo
(boost::asio::io_service& ioService,
size_t
limit = 10);
45
46
virtual
47
~InMemoryStorageFifo
();
48
49
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
:
53
virtual
bool
54
evictItem
();
55
58
virtual
void
59
afterInsert
(
InMemoryStorageEntry
* entry);
60
64
virtual
void
65
beforeErase
(
InMemoryStorageEntry
* entry);
66
67
private
:
68
//multi_index_container to implement FIFO
69
class
byArrival;
70
class
byEntity;
71
72
typedef
boost::multi_index_container<
73
InMemoryStorageEntry
*,
74
boost::multi_index::indexed_by<
75
76
// by Entry itself
77
boost::multi_index::hashed_unique<
78
boost::multi_index::tag<byEntity>,
79
boost::multi_index::identity<InMemoryStorageEntry*>
80
>,
81
82
// by arrival (FIFO)
83
boost::multi_index::sequenced<
84
boost::multi_index::tag<byArrival>
85
>
86
87
>
88
> CleanupIndex;
89
90
CleanupIndex m_cleanupIndex;
91
};
92
93
}
// namespace util
94
}
// namespace ndn
95
96
#endif // NDN_UTIL_IN_MEMORY_STORAGE_FIFO_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
in-memory-storage.hpp
ndn::util::InMemoryStorageFifo
Provides in-memory storage employing FIFO replacement policy, which is first in first out...
Definition:
in-memory-storage-fifo.hpp:37
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...
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_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
Definition:
common.hpp: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
ndnSIM
ndn-cxx
src
util
in-memory-storage-fifo.hpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12