NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: 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
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
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
h
i
k
l
n
o
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
f
i
k
l
n
p
q
r
s
t
u
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
j
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
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
_
a
c
e
i
r
s
t
v
+
Enumerator
a
c
d
e
f
i
k
l
m
n
p
r
s
u
v
w
+
Related Functions
b
c
d
e
f
g
i
k
l
m
n
o
p
s
v
+
Files
File List
+
File Members
+
All
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
f
g
i
k
l
m
n
p
r
s
t
Typedefs
+
Macros
a
d
e
f
i
l
m
n
o
p
r
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
cs-policy-lru.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_POLICY_LRU_HPP
27
#define NFD_DAEMON_TABLE_CS_POLICY_LRU_HPP
28
29
#include "
cs-policy.hpp
"
30
31
#include <boost/multi_index_container.hpp>
32
#include <boost/multi_index/sequenced_index.hpp>
33
#include <boost/multi_index/hashed_index.hpp>
34
35
namespace
nfd
{
36
namespace
cs {
37
namespace
lru {
38
39
struct
EntryItComparator
40
{
41
bool
42
operator()
(
const
iterator
& a,
const
iterator
& b)
const
43
{
44
return
*a < *b;
45
}
46
};
47
48
typedef
boost::multi_index_container<
49
iterator
,
50
boost::multi_index::indexed_by<
51
boost::multi_index::sequenced<>,
52
boost::multi_index::ordered_unique<
53
boost::multi_index::identity<iterator>, EntryItComparator
54
>
55
>
56
>
Queue
;
57
64
class
LruPolicy
:
public
Policy
65
{
66
public
:
67
LruPolicy
();
68
69
public
:
70
static
const
std::string
POLICY_NAME
;
71
72
private
:
73
virtual
void
74
doAfterInsert(
iterator
i)
override
;
75
76
virtual
void
77
doAfterRefresh(
iterator
i)
override
;
78
79
virtual
void
80
doBeforeErase(
iterator
i)
override
;
81
82
virtual
void
83
doBeforeUse(
iterator
i)
override
;
84
85
virtual
void
86
evictEntries()
override
;
87
88
private
:
91
void
92
insertToQueue(
iterator
i,
bool
isNewEntry);
93
94
private
:
95
Queue
m_queue;
96
};
97
98
}
// namespace lru
99
100
using
lru::LruPolicy
;
101
102
}
// namespace cs
103
}
// namespace nfd
104
105
#endif // NFD_DAEMON_TABLE_CS_POLICY_LRU_HPP
nfd::cs::lru::EntryItComparator
Definition:
cs-policy-lru.hpp:39
nfd::cs::lru::EntryItComparator::operator()
bool operator()(const iterator &a, const iterator &b) const
Definition:
cs-policy-lru.hpp:42
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
nfd::cs::Policy
represents a CS replacement policy
Definition:
cs-policy.hpp:39
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::cs::lru::Queue
boost::multi_index_container< iterator, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::ordered_unique< boost::multi_index::identity< iterator >, EntryItComparator > > > Queue
Definition:
cs-policy-lru.hpp:56
nfd::cs::lru::LruPolicy
LRU cs replacement policy.
Definition:
cs-policy-lru.hpp:64
cs-policy.hpp
nfd::cs::lru::LruPolicy::LruPolicy
LruPolicy()
Definition:
cs-policy-lru.cpp:36
nfd::cs::lru::LruPolicy::POLICY_NAME
static const std::string POLICY_NAME
Definition:
cs-policy-lru.hpp:70
ndnSIM
NFD
daemon
table
cs-policy-lru.hpp
Generated on Sun Feb 24 2019 22:16:07 for ndnSIM by
1.8.15