blob: 5f28c0a98bbfde6c48cd9b80674cdc7c6cf7733e [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 Afanasyevcd31abd2013-09-05 20:45:02 -07004 *
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 Afanasyevcd31abd2013-09-05 20:45:02 -07007 *
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 Afanasyevcd31abd2013-09-05 20:45:02 -070011 *
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 Afanasyevcd31abd2013-09-05 20:45:02 -070015 *
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 Afanasyevcd31abd2013-09-05 20:45:02 -070019
Alexander Afanasyev0c395372014-12-20 15:54:02 -080020#include "content-store-with-probability.hpp"
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070021
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 Afanasyevcd31abd2013-09-05 20:45:02 -070026
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 Afanasyevcd31abd2013-09-05 20:45:02 -070035
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 ContentStoreWithProbability<lru_policy_traits>;
48
49/**
50 * @brief ContentStore with freshness and random cache replacement policy
51 **/
52template class ContentStoreWithProbability<random_policy_traits>;
53
54/**
55 * @brief ContentStore with freshness and FIFO cache replacement policy
56 **/
57template class ContentStoreWithProbability<fifo_policy_traits>;
58
59/**
60 * @brief ContentStore with freshness and Least Frequently Used (LFU) cache replacement policy
61 **/
62template class ContentStoreWithProbability<lfu_policy_traits>;
63
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070064NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, lru_policy_traits);
65NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, random_policy_traits);
66NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, fifo_policy_traits);
67
68NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, lfu_policy_traits);
69
70#ifdef DOXYGEN
71// /**
72// * \brief Content Store with freshness implementing LRU cache replacement policy
73// */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080074class Probability::Lru : public ContentStoreWithProbability<lru_policy_traits> {
75};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070076
77/**
78 * \brief Content Store with freshness implementing FIFO cache replacement policy
79 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080080class Probability::Fifo : public ContentStoreWithProbability<fifo_policy_traits> {
81};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070082
83/**
84 * \brief Content Store with freshness implementing Random cache replacement policy
85 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080086class Probability::Random : public ContentStoreWithProbability<random_policy_traits> {
87};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070088
89/**
90 * \brief Content Store with freshness implementing Least Frequently Used cache replacement policy
91 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080092class Probability::Lfu : public ContentStoreWithProbability<lfu_policy_traits> {
93};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070094
95#endif
96
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070097} // namespace cs
98} // namespace ndn
99} // namespace ns3