blob: 36918919dc3ec3d4225ccdba5d027d006ba498a1 [file] [log] [blame]
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -08001/* -*- 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
21#include "content-store-with-freshness.h"
22
23#include "../../utils/trie/random-policy.h"
24#include "../../utils/trie/lru-policy.h"
25#include "../../utils/trie/fifo-policy.h"
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080026#include "../../utils/trie/lfu-policy.h"
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080027
28#define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \
29 static struct X ## type ## templ ## RegistrationClass \
30 { \
31 X ## type ## templ ## RegistrationClass () { \
32 ns3::TypeId tid = type<templ>::GetTypeId (); \
33 tid.GetParent (); \
34 } \
35 } x_ ## type ## templ ## RegistrationVariable
36
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 ContentStoreWithFreshness<lru_policy_traits>;
49
50/**
51 * @brief ContentStore with freshness and random cache replacement policy
52 **/
53template class ContentStoreWithFreshness<random_policy_traits>;
54
55/**
56 * @brief ContentStore with freshness and FIFO cache replacement policy
57 **/
58template class ContentStoreWithFreshness<fifo_policy_traits>;
59
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080060/**
61 * @brief ContentStore with freshness and Least Frequently Used (LFU) cache replacement policy
62 **/
63template class ContentStoreWithFreshness<lfu_policy_traits>;
64
65
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080066NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, lru_policy_traits);
67NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, random_policy_traits);
68NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, fifo_policy_traits);
69
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080070NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithFreshness, lfu_policy_traits);
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080071
72#ifdef DOXYGEN
73// /**
74// * \brief Content Store with freshness implementing LRU cache replacement policy
75// */
76class Freshness::Lru : public ContentStoreWithFreshness<lru_policy_traits> { };
77
78/**
79 * \brief Content Store with freshness implementing FIFO cache replacement policy
80 */
81class Freshness::Fifo : public ContentStoreWithFreshness<fifo_policy_traits> { };
82
83/**
84 * \brief Content Store with freshness implementing Random cache replacement policy
85 */
86class Freshness::Random : public ContentStoreWithFreshness<random_policy_traits> { };
87
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080088/**
89 * \brief Content Store with freshness implementing Least Frequently Used cache replacement policy
90 */
91class Freshness::Lfu : public ContentStoreWithFreshness<lfu_policy_traits> { };
92
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080093#endif
94
95
96} // namespace cs
97} // namespace ndn
98} // namespace ns3