blob: c60236b2690666440cbf14f94ef3d239d216da5c [file] [log] [blame]
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2011-2015 Regents of the University of California.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -08004 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08005 * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
6 * contributors.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -08007 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08008 * ndnSIM is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080011 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -080012 * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080015 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -080016 * You should have received a copy of the GNU General Public License along with
17 * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 **/
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080019
Alexander Afanasyev0c395372014-12-20 15:54:02 -080020#include "content-store-with-freshness.hpp"
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080021
Alexander Afanasyev0c395372014-12-20 15:54:02 -080022#include "../../utils/trie/random-policy.hpp"
23#include "../../utils/trie/lru-policy.hpp"
24#include "../../utils/trie/fifo-policy.hpp"
25#include "../../utils/trie/lfu-policy.hpp"
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080026
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080027#define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \
28 static struct X##type##templ##RegistrationClass { \
29 X##type##templ##RegistrationClass() \
30 { \
31 ns3::TypeId tid = type<templ>::GetTypeId(); \
32 tid.GetParent(); \
33 } \
34 } x_##type##templ##RegistrationVariable
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080035
36namespace ns3 {
37namespace ndn {
38
39using namespace ndnSIM;
40
41namespace cs {
42
43// explicit instantiation and registering
44/**
45 * @brief ContentStore with freshness and LRU cache replacement policy
46 **/
47template class ContentStoreWithFreshness<lru_policy_traits>;
48
49/**
50 * @brief ContentStore with freshness and random cache replacement policy
51 **/
52template class ContentStoreWithFreshness<random_policy_traits>;
53
54/**
55 * @brief ContentStore with freshness and FIFO cache replacement policy
56 **/
57template class ContentStoreWithFreshness<fifo_policy_traits>;
58
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080059/**
60 * @brief ContentStore with freshness and Least Frequently Used (LFU) cache replacement policy
61 **/
62template class ContentStoreWithFreshness<lfu_policy_traits>;
63
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080064NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, lru_policy_traits);
65NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, random_policy_traits);
66NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, fifo_policy_traits);
67
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080068NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, lfu_policy_traits);
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080069
70#ifdef DOXYGEN
71// /**
72// * \brief Content Store with freshness implementing LRU cache replacement policy
73// */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080074class Freshness::Lru : public ContentStoreWithFreshness<lru_policy_traits> {
75};
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080076
77/**
78 * \brief Content Store with freshness implementing FIFO cache replacement policy
79 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080080class Freshness::Fifo : public ContentStoreWithFreshness<fifo_policy_traits> {
81};
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080082
83/**
84 * \brief Content Store with freshness implementing Random cache replacement policy
85 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080086class Freshness::Random : public ContentStoreWithFreshness<random_policy_traits> {
87};
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080088
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080089/**
90 * \brief Content Store with freshness implementing Least Frequently Used cache replacement policy
91 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080092class Freshness::Lfu : public ContentStoreWithFreshness<lfu_policy_traits> {
93};
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080094
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080095#endif
96
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080097} // namespace cs
98} // namespace ndn
99} // namespace ns3