NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
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
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
:
50
virtual
bool
51
evictItem
()
override
;
52
55
virtual
void
56
afterInsert
(
InMemoryStorageEntry
* entry)
override
;
57
61
virtual
void
62
beforeErase
(
InMemoryStorageEntry
* entry)
override
;
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::InMemoryStorageFifo::afterInsert
virtual void afterInsert(InMemoryStorageEntry *entry) override
Update the entry after a entry is successfully inserted, add it to the cleanupIndex.
Definition:
in-memory-storage-fifo.cpp:38
ndn::util::InMemoryStorageEntry
Represents an in-memory storage entry.
Definition:
in-memory-storage-entry.hpp:35
ndn::util::InMemoryStorageFifo::beforeErase
virtual void beforeErase(InMemoryStorageEntry *entry) override
Update the entry or other data structures before a entry is successfully erased, erase it from the cl...
Definition:
in-memory-storage-fifo.cpp:58
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
Definition:
common.hpp:42
ndnSIM
ndn-cxx
src
util
in-memory-storage-fifo.hpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13