util: Support MustBeFresh processing in InMemoryStorage
Change-Id: I8e8e647d7673e4e0fe8dd1c5025fbc8e5e524c70
Refs: #3274
diff --git a/src/util/in-memory-storage-entry.cpp b/src/util/in-memory-storage-entry.cpp
index ae34ba2..c0f5e59 100644
--- a/src/util/in-memory-storage-entry.cpp
+++ b/src/util/in-memory-storage-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,16 +24,35 @@
namespace ndn {
namespace util {
+InMemoryStorageEntry::InMemoryStorageEntry()
+ : m_isFresh(true)
+{
+}
+
void
InMemoryStorageEntry::release()
{
m_dataPacket.reset();
+ m_markStaleEventId.reset();
}
void
InMemoryStorageEntry::setData(const Data& data)
{
m_dataPacket = data.shared_from_this();
+ m_isFresh = true;
+}
+
+void
+InMemoryStorageEntry::setMarkStaleEventId(unique_ptr<scheduler::ScopedEventId>&& markStaleEventId)
+{
+ m_markStaleEventId = std::move(markStaleEventId);
+}
+
+void
+InMemoryStorageEntry::markStale()
+{
+ m_isFresh = false;
}
} // namespace util