blob: bcdf098c2e1237d63a0036cb40009668e10ec93f [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 Afanasyev8566f452012-12-10 15:21:51 -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 Afanasyev8566f452012-12-10 15:21:51 -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 Afanasyev8566f452012-12-10 15:21:51 -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 Afanasyev8566f452012-12-10 15:21:51 -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 Afanasyev8566f452012-12-10 15:21:51 -080019
Alexander Afanasyev0c395372014-12-20 15:54:02 -080020#include "content-store-with-stats.hpp"
Alexander Afanasyev8566f452012-12-10 15:21:51 -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 Afanasyev8566f452012-12-10 15:21:51 -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 Afanasyev8566f452012-12-10 15:21:51 -080035
36namespace ns3 {
37namespace ndn {
38
39using namespace ndnSIM;
40
41namespace cs {
42
43// explicit instantiation and registering
44/**
45 * @brief ContentStore with stats and LRU cache replacement policy
46 **/
47template class ContentStoreWithStats<lru_policy_traits>;
48
49/**
50 * @brief ContentStore with stats and random cache replacement policy
51 **/
52template class ContentStoreWithStats<random_policy_traits>;
53
54/**
55 * @brief ContentStore with stats and FIFO cache replacement policy
56 **/
57template class ContentStoreWithStats<fifo_policy_traits>;
58
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080059/**
60 * @brief ContentStore with stats and Least Frequently Used (LFU) cache replacement policy
61 **/
62template class ContentStoreWithStats<lfu_policy_traits>;
63
Alexander Afanasyev8566f452012-12-10 15:21:51 -080064NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, lru_policy_traits);
65NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, random_policy_traits);
66NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, fifo_policy_traits);
67
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080068NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, lfu_policy_traits);
69
Alexander Afanasyev8566f452012-12-10 15:21:51 -080070#ifdef DOXYGEN
71// /**
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080072// * \brief Content Store with stats implementing LRU cache replacement policy
Alexander Afanasyev8566f452012-12-10 15:21:51 -080073// */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080074class Stats::Lru : public ContentStoreWithStats<lru_policy_traits> {
75};
Alexander Afanasyev8566f452012-12-10 15:21:51 -080076
77/**
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080078 * \brief Content Store with stats implementing FIFO cache replacement policy
Alexander Afanasyev8566f452012-12-10 15:21:51 -080079 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080080class Stats::Fifo : public ContentStoreWithStats<fifo_policy_traits> {
81};
Alexander Afanasyev8566f452012-12-10 15:21:51 -080082
83/**
Alexander Afanasyevc3cc0b32012-12-12 18:41:20 -080084 * \brief Content Store with stats implementing Random cache replacement policy
Alexander Afanasyev8566f452012-12-10 15:21:51 -080085 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080086class Stats::Random : public ContentStoreWithStats<random_policy_traits> {
87};
Alexander Afanasyev8566f452012-12-10 15:21:51 -080088
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080089/**
90 * \brief Content Store with stats implementing Least Frequently Used cache replacement policy
91 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080092class Stats::Lfu : public ContentStoreWithStats<lfu_policy_traits> {
93};
Alexander Afanasyev41824bd2013-01-23 23:57:59 -080094
Alexander Afanasyev8566f452012-12-10 15:21:51 -080095#endif
96
Alexander Afanasyev8566f452012-12-10 15:21:51 -080097} // namespace cs
98} // namespace ndn
99} // namespace ns3