blob: 39eab27a39781204f38783602bdb4e94a9295cc0 [file] [log] [blame]
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -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
21#include "content-store-impl.h"
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070022
Alexander Afanasyev1a2df6a2012-08-17 13:21:51 -070023#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 Afanasyev2b4c9472012-08-09 15:00:38 -070027
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070028#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
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070044// explicit instantiation and registering
Alexander Afanasyev1cd79ae2012-10-05 22:42:12 -070045/**
46 * @brief ContentStore with LRU cache replacement policy
47 **/
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070048template class ContentStoreImpl<lru_policy_traits>;
Alexander Afanasyev1cd79ae2012-10-05 22:42:12 -070049
50/**
51 * @brief ContentStore with random cache replacement policy
52 **/
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070053template class ContentStoreImpl<random_policy_traits>;
Alexander Afanasyev1cd79ae2012-10-05 22:42:12 -070054
55/**
56 * @brief ContentStore with FIFO cache replacement policy
57 **/
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070058template class ContentStoreImpl<fifo_policy_traits>;
59
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080060/**
61 * @brief ContentStore with Least Frequently Used (LFU) cache replacement policy
62 **/
63template class ContentStoreImpl<lfu_policy_traits>;
64
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070065NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, lru_policy_traits);
66NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, random_policy_traits);
67NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, fifo_policy_traits);
68
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080069NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, lfu_policy_traits);
70
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080071#ifdef DOXYGEN
72// /**
73// * \brief Content Store implementing LRU cache replacement policy
74// */
75class Lru : public ContentStoreImpl<lru_policy_traits> { };
76
77/**
78 * \brief Content Store implementing FIFO cache replacement policy
79 */
80class Fifo : public ContentStoreImpl<fifo_policy_traits> { };
81
82/**
83 * \brief Content Store implementing Random cache replacement policy
84 */
85class Random : public ContentStoreImpl<random_policy_traits> { };
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080086
87/**
88 * \brief Content Store implementing Least Frequently Used cache replacement policy
89 */
90class Lfu : public ContentStoreImpl<lfu_policy_traits> { };
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080091#endif
92
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070093
94} // namespace cs
95} // namespace ndn
96} // namespace ns3