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
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
virtual
44
~InMemoryStorageFifo
();
45
46
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
:
50
virtual
bool
51
evictItem
();
52
55
virtual
void
56
afterInsert
(
InMemoryStorageEntry
* entry);
57
61
virtual
void
62
beforeErase
(
InMemoryStorageEntry
* entry);
63
64
private
:
65
//multi_index_container to implement FIFO
66
class
byArrival;
67
class
byEntity;
68
69
typedef
boost::multi_index_container<
70
InMemoryStorageEntry
*,
71
boost::multi_index::indexed_by<
72
73
// by Entry itself
74
boost::multi_index::hashed_unique<
75
boost::multi_index::tag<byEntity>,
76
boost::multi_index::identity<InMemoryStorageEntry*>
77
>,
78
79
// by arrival (FIFO)
80
boost::multi_index::sequenced<
81
boost::multi_index::tag<byArrival>
82
>
83
84
>
85
> CleanupIndex;
86
87
CleanupIndex m_cleanupIndex;
88
};
89
90
}
// namespace util
91
}
// namespace ndn
92
93
#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:34
ndn::util::InMemoryStorageFifo::~InMemoryStorageFifo
virtual ~InMemoryStorageFifo()
Definition:
in-memory-storage-fifo.cpp:32
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:37
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:57
ndnSIM
ndn-cxx
src
util
in-memory-storage-fifo.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11