NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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 
38 {
39 public:
40  explicit
41  InMemoryStorageFifo(size_t limit = 10);
42 
43  virtual
45 
50  virtual bool
52 
55  virtual void
57 
61  virtual void
63 
64 private:
65  //multi_index_container to implement FIFO
66  class byArrival;
67  class byEntity;
68 
69  typedef boost::multi_index_container<
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
Copyright (c) 2011-2015 Regents of the University of California.
Provides in-memory storage employing FIFO replacement policy, which is first in first out...
virtual bool evictItem()=0
Removes one Data packet from in-memory storage based on derived class implemented replacement policy...
Represents in-memory storage.
Represents an in-memory storage entry.
virtual void afterInsert(InMemoryStorageEntry *entry)
Update the entry after a entry is successfully inserted, add it to the cleanupIndex.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
Definition: common.hpp:42
virtual void beforeErase(InMemoryStorageEntry *entry)
Update the entry or other data structures before a entry is successfully erased, erase it from the cl...