NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
in-memory-storage-entry.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_ENTRY_HPP
23 #define NDN_UTIL_IN_MEMORY_STORAGE_ENTRY_HPP
24 
25 #include "../common.hpp"
26 #include "../interest.hpp"
27 #include "../data.hpp"
29 
30 namespace ndn {
31 namespace util {
32 
35 class InMemoryStorageEntry : noncopyable
36 {
37 public:
38 
42 
45  void
46  release();
47 
50  const Name&
51  getName() const
52  {
53  return m_dataPacket->getName();
54  }
55 
59  const Name&
60  getFullName() const
61  {
62  return m_dataPacket->getFullName();
63  }
64 
65 
68  const Data&
69  getData() const
70  {
71  return *m_dataPacket;
72  }
73 
74 
79  void
80  setData(const Data& data);
81 
84  void
85  setMarkStaleEventId(unique_ptr<scheduler::ScopedEventId>&& eventId);
86 
89  void
90  markStale();
91 
94  bool
96  {
97  return m_isFresh;
98  }
99 
100 private:
101  shared_ptr<const Data> m_dataPacket;
102 
103  bool m_isFresh;
104  unique_ptr<scheduler::ScopedEventId> m_markStaleEventId;
105 };
106 
107 } // namespace util
108 } // namespace ndn
109 
110 #endif // NDN_UTIL_IN_MEMORY_STORAGE_ENTRY_HPP
const Data & getData() const
Returns the Data packet stored in the in-memory storage entry.
Copyright (c) 2011-2015 Regents of the University of California.
void release()
Releases reference counts on shared objects.
const Name & getFullName() const
Returns the full name (including implicit digest) of the Data packet stored in the in-memory storage ...
void markStale()
Disable the data from satisfying interest with MustBeFresh.
const Name & getName() const
Returns the name of the Data packet stored in the in-memory storage entry.
void setMarkStaleEventId(unique_ptr< scheduler::ScopedEventId > &&eventId)
Set eventId for the markStale event.
Represents an in-memory storage entry.
Name abstraction to represent an absolute name.
Definition: name.hpp:46
represents a Data packet
Definition: data.hpp:39
void setData(const Data &data)
Changes the content of in-memory storage entry.
bool isFresh()
Check if the data can satisfy an interest with MustBeFresh.