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
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 "common.hpp"
31
#include "
core/scheduler.hpp
"
32
33
namespace
nfd
{
34
namespace
cs {
35
namespace
priority_fifo {
36
37
typedef
std::list<iterator>
Queue
;
38
typedef
Queue::iterator
QueueIt
;
39
40
enum
QueueType
{
41
QUEUE_UNSOLICITED
,
42
QUEUE_STALE
,
43
QUEUE_FIFO
,
44
QUEUE_MAX
45
};
46
47
struct
EntryInfo
48
{
49
QueueType
queueType
;
50
QueueIt
queueIt
;
51
scheduler::EventId
moveStaleEventId
;
52
};
53
54
struct
EntryItComparator
55
{
56
bool
57
operator()
(
const
iterator
& a,
const
iterator
& b)
const
58
{
59
return
*a < *b;
60
}
61
};
62
63
typedef
std::map<iterator, EntryInfo*, EntryItComparator>
EntryInfoMapFifo
;
64
73
class
PriorityFifoPolicy
:
public
Policy
74
{
75
public
:
76
PriorityFifoPolicy
();
77
78
public
:
79
static
const
std::string
POLICY_NAME
;
80
81
private
:
82
virtual
void
83
doAfterInsert(
iterator
i)
DECL_OVERRIDE
;
84
85
virtual
void
86
doAfterRefresh(
iterator
i)
DECL_OVERRIDE
;
87
88
virtual
void
89
doBeforeErase(
iterator
i)
DECL_OVERRIDE
;
90
91
virtual
void
92
doBeforeUse(
iterator
i)
DECL_OVERRIDE
;
93
94
virtual
void
95
evictEntries() DECL_OVERRIDE;
96
97
private:
101
void
102
evictOne();
103
107
void
108
attachQueue(
iterator
i);
109
113
void
114
detachQueue(
iterator
i);
115
118
void
119
moveToStaleQueue(
iterator
i);
120
121
private:
122
Queue m_queues[
QUEUE_MAX
];
123
EntryInfoMapFifo m_entryInfoMap;
124
};
125
126
}
// namespace priorityfifo
127
128
using priority_fifo::
PriorityFifoPolicy
;
129
130
}
// namespace cs
131
}
// namespace nfd
132
133
#endif // NFD_DAEMON_TABLE_CS_POLICY_FIFO_HPP
nfd::cs::priority_fifo::EntryInfo::queueIt
QueueIt queueIt
Definition:
cs-policy-priority-fifo.hpp:50
nfd::cs::priority_fifo::QueueType
QueueType
Definition:
cs-policy-priority-fifo.hpp:40
nfd::cs::priority_fifo::QUEUE_FIFO
Definition:
cs-policy-priority-fifo.hpp:43
nfd::scheduler::EventId
std::shared_ptr< ns3::EventId > EventId
Definition:
scheduler.hpp:39
DECL_OVERRIDE
#define DECL_OVERRIDE
expands to 'override' if compiler supports this feature, otherwise expands to nothing ...
Definition:
common.hpp:49
nfd::cs::priority_fifo::QUEUE_STALE
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:57
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::cs::priority_fifo::QUEUE_UNSOLICITED
Definition:
cs-policy-priority-fifo.hpp:41
nfd::cs::priority_fifo::Queue
std::list< iterator > Queue
Definition:
cs-policy-priority-fifo.hpp:37
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::cs::priority_fifo::PriorityFifoPolicy::POLICY_NAME
static const std::string POLICY_NAME
Definition:
cs-policy-priority-fifo.hpp:79
nfd::cs::priority_fifo::EntryItComparator
Definition:
cs-policy-priority-fifo.hpp:54
nfd::cs::priority_fifo::EntryInfo::queueType
QueueType queueType
Definition:
cs-policy-priority-fifo.hpp:49
scheduler.hpp
nfd::cs::priority_fifo::EntryInfo::moveStaleEventId
scheduler::EventId moveStaleEventId
Definition:
cs-policy-priority-fifo.hpp:51
cs-policy.hpp
nfd::cs::priority_fifo::QUEUE_MAX
Definition:
cs-policy-priority-fifo.hpp:44
nfd::cs::priority_fifo::EntryInfoMapFifo
std::map< iterator, EntryInfo *, EntryItComparator > EntryInfoMapFifo
Definition:
cs-policy-priority-fifo.hpp:63
nfd::cs::priority_fifo::QueueIt
Queue::iterator QueueIt
Definition:
cs-policy-priority-fifo.hpp:38
nfd::cs::priority_fifo::PriorityFifoPolicy
Priority Fifo cs replacement policy.
Definition:
cs-policy-priority-fifo.hpp:73
nfd::cs::priority_fifo::EntryInfo
Definition:
cs-policy-priority-fifo.hpp:47
ndnSIM
NFD
daemon
table
cs-policy-priority-fifo.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11