NFD: Named Data Networking Forwarding Daemon 0.6.0 documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
cs-policy-priority-fifo.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_FIFO_HPP
27
#define NFD_DAEMON_TABLE_CS_POLICY_FIFO_HPP
28
29
#include "
cs-policy.hpp
"
30
#include "
core/scheduler.hpp
"
31
32
namespace
nfd
{
33
namespace
cs {
34
namespace
priority_fifo {
35
36
typedef
std::list<iterator>
Queue
;
37
typedef
Queue::iterator
QueueIt
;
38
39
enum
QueueType
{
40
QUEUE_UNSOLICITED
,
41
QUEUE_STALE
,
42
QUEUE_FIFO
,
43
QUEUE_MAX
44
};
45
46
struct
EntryInfo
47
{
48
QueueType
queueType
;
49
QueueIt
queueIt
;
50
scheduler::EventId
moveStaleEventId
;
51
};
52
53
struct
EntryItComparator
54
{
55
bool
56
operator()
(
const
iterator
& a,
const
iterator
& b)
const
57
{
58
return
*a < *b;
59
}
60
};
61
62
typedef
std::map<iterator, EntryInfo*, EntryItComparator>
EntryInfoMapFifo
;
63
72
class
PriorityFifoPolicy
:
public
Policy
73
{
74
public
:
75
PriorityFifoPolicy
();
76
77
virtual
78
~
PriorityFifoPolicy
();
79
80
public
:
81
static
const
std::string
POLICY_NAME
;
82
83
private
:
84
virtual
void
85
doAfterInsert(
iterator
i)
override
;
86
87
virtual
void
88
doAfterRefresh(
iterator
i)
override
;
89
90
virtual
void
91
doBeforeErase(
iterator
i)
override
;
92
93
virtual
void
94
doBeforeUse(
iterator
i)
override
;
95
96
virtual
void
97
evictEntries()
override
;
98
99
private
:
103
void
104
evictOne();
105
109
void
110
attachQueue(
iterator
i);
111
115
void
116
detachQueue(
iterator
i);
117
120
void
121
moveToStaleQueue(
iterator
i);
122
123
private
:
124
Queue m_queues[
QUEUE_MAX
];
125
EntryInfoMapFifo m_entryInfoMap;
126
};
127
128
}
// namespace priority_fifo
129
130
using
priority_fifo::PriorityFifoPolicy
;
131
132
}
// namespace cs
133
}
// namespace nfd
134
135
#endif // NFD_DAEMON_TABLE_CS_POLICY_FIFO_HPP
nfd::cs::priority_fifo::EntryInfo::queueIt
QueueIt queueIt
Definition:
cs-policy-priority-fifo.hpp:49
nfd::cs::priority_fifo::PriorityFifoPolicy
Priority Fifo cs replacement policy.
Definition:
cs-policy-priority-fifo.hpp:72
nfd::cs::priority_fifo::PriorityFifoPolicy::POLICY_NAME
static const std::string POLICY_NAME
Definition:
cs-policy-priority-fifo.hpp:81
nfd::cs::priority_fifo::QueueType
QueueType
Definition:
cs-policy-priority-fifo.hpp:39
nfd::cs::priority_fifo::QUEUE_FIFO
Definition:
cs-policy-priority-fifo.hpp:42
nfd::cs::priority_fifo::EntryItComparator::operator()
bool operator()(const iterator &a, const iterator &b) const
Definition:
cs-policy-priority-fifo.hpp:56
nfd::cs::priority_fifo::EntryInfo
Definition:
cs-policy-priority-fifo.hpp:46
nfd::cs::priority_fifo::EntryInfo::moveStaleEventId
scheduler::EventId moveStaleEventId
Definition:
cs-policy-priority-fifo.hpp:50
nfd::cs::priority_fifo::QUEUE_STALE
Definition:
cs-policy-priority-fifo.hpp:41
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
nfd::cs::priority_fifo::QUEUE_UNSOLICITED
Definition:
cs-policy-priority-fifo.hpp:40
scheduler.hpp
nfd::cs::priority_fifo::Queue
std::list< iterator > Queue
Definition:
cs-policy-priority-fifo.hpp:36
nfd
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition:
algorithm.hpp:32
nfd::cs::Policy
represents a CS replacement policy
Definition:
cs-policy.hpp:39
nfd::cs::priority_fifo::EntryItComparator
Definition:
cs-policy-priority-fifo.hpp:53
cs-policy.hpp
nfd::cs::priority_fifo::QUEUE_MAX
Definition:
cs-policy-priority-fifo.hpp:43
nfd::cs::priority_fifo::EntryInfo::queueType
QueueType queueType
Definition:
cs-policy-priority-fifo.hpp:48
nfd::cs::priority_fifo::EntryInfoMapFifo
std::map< iterator, EntryInfo *, EntryItComparator > EntryInfoMapFifo
Definition:
cs-policy-priority-fifo.hpp:62
nfd::cs::priority_fifo::QueueIt
Queue::iterator QueueIt
Definition:
cs-policy-priority-fifo.hpp:37
daemon
table
cs-policy-priority-fifo.hpp
Generated on Mon Oct 16 2017 13:51:50 for NFD: Named Data Networking Forwarding Daemon by
1.8.11