blob: 313cb368d9f00d430585673e77a9e30ad91f3f3a [file] [log] [blame]
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
Alexander Afanasyev0c395372014-12-20 15:54:02 -080021#include "content-store-with-probability.hpp"
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070022
Alexander Afanasyev0c395372014-12-20 15:54:02 -080023#include "../../utils/trie/random-policy.hpp"
24#include "../../utils/trie/lru-policy.hpp"
25#include "../../utils/trie/fifo-policy.hpp"
26#include "../../utils/trie/lfu-policy.hpp"
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070027
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080028#define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \
29 static struct X##type##templ##RegistrationClass { \
30 X##type##templ##RegistrationClass() \
31 { \
32 ns3::TypeId tid = type<templ>::GetTypeId(); \
33 tid.GetParent(); \
34 } \
35 } x_##type##templ##RegistrationVariable
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070036
37namespace ns3 {
38namespace ndn {
39
40using namespace ndnSIM;
41
42namespace cs {
43
44// explicit instantiation and registering
45/**
46 * @brief ContentStore with freshness and LRU cache replacement policy
47 **/
48template class ContentStoreWithProbability<lru_policy_traits>;
49
50/**
51 * @brief ContentStore with freshness and random cache replacement policy
52 **/
53template class ContentStoreWithProbability<random_policy_traits>;
54
55/**
56 * @brief ContentStore with freshness and FIFO cache replacement policy
57 **/
58template class ContentStoreWithProbability<fifo_policy_traits>;
59
60/**
61 * @brief ContentStore with freshness and Least Frequently Used (LFU) cache replacement policy
62 **/
63template class ContentStoreWithProbability<lfu_policy_traits>;
64
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070065NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, lru_policy_traits);
66NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, random_policy_traits);
67NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, fifo_policy_traits);
68
69NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithProbability, lfu_policy_traits);
70
71#ifdef DOXYGEN
72// /**
73// * \brief Content Store with freshness implementing LRU cache replacement policy
74// */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080075class Probability::Lru : public ContentStoreWithProbability<lru_policy_traits> {
76};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070077
78/**
79 * \brief Content Store with freshness implementing FIFO cache replacement policy
80 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080081class Probability::Fifo : public ContentStoreWithProbability<fifo_policy_traits> {
82};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070083
84/**
85 * \brief Content Store with freshness implementing Random cache replacement policy
86 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080087class Probability::Random : public ContentStoreWithProbability<random_policy_traits> {
88};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070089
90/**
91 * \brief Content Store with freshness implementing Least Frequently Used cache replacement policy
92 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080093class Probability::Lfu : public ContentStoreWithProbability<lfu_policy_traits> {
94};
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070095
96#endif
97
Alexander Afanasyevcd31abd2013-09-05 20:45:02 -070098} // namespace cs
99} // namespace ndn
100} // namespace ns3