Alexander Afanasyev | 8566f45 | 2012-12-10 15:21:51 -0800 | [diff] [blame] | 1 | /* -*- 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-stats.h" |
| 22 | |
| 23 | #include "../../utils/trie/random-policy.h" |
| 24 | #include "../../utils/trie/lru-policy.h" |
| 25 | #include "../../utils/trie/fifo-policy.h" |
| 26 | |
| 27 | #define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \ |
| 28 | static struct X ## type ## templ ## RegistrationClass \ |
| 29 | { \ |
| 30 | X ## type ## templ ## RegistrationClass () { \ |
| 31 | ns3::TypeId tid = type<templ>::GetTypeId (); \ |
| 32 | tid.GetParent (); \ |
| 33 | } \ |
| 34 | } x_ ## type ## templ ## RegistrationVariable |
| 35 | |
| 36 | namespace ns3 { |
| 37 | namespace ndn { |
| 38 | |
| 39 | using namespace ndnSIM; |
| 40 | |
| 41 | namespace cs { |
| 42 | |
| 43 | // explicit instantiation and registering |
| 44 | /** |
| 45 | * @brief ContentStore with stats and LRU cache replacement policy |
| 46 | **/ |
| 47 | template class ContentStoreWithStats<lru_policy_traits>; |
| 48 | |
| 49 | /** |
| 50 | * @brief ContentStore with stats and random cache replacement policy |
| 51 | **/ |
| 52 | template class ContentStoreWithStats<random_policy_traits>; |
| 53 | |
| 54 | /** |
| 55 | * @brief ContentStore with stats and FIFO cache replacement policy |
| 56 | **/ |
| 57 | template class ContentStoreWithStats<fifo_policy_traits>; |
| 58 | |
| 59 | NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, lru_policy_traits); |
| 60 | NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, random_policy_traits); |
| 61 | NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreWithStats, fifo_policy_traits); |
| 62 | |
| 63 | |
| 64 | #ifdef DOXYGEN |
| 65 | // /** |
Alexander Afanasyev | c3cc0b3 | 2012-12-12 18:41:20 -0800 | [diff] [blame] | 66 | // * \brief Content Store with stats implementing LRU cache replacement policy |
Alexander Afanasyev | 8566f45 | 2012-12-10 15:21:51 -0800 | [diff] [blame] | 67 | // */ |
| 68 | class Stats::Lru : public ContentStoreWithStats<lru_policy_traits> { }; |
| 69 | |
| 70 | /** |
Alexander Afanasyev | c3cc0b3 | 2012-12-12 18:41:20 -0800 | [diff] [blame] | 71 | * \brief Content Store with stats implementing FIFO cache replacement policy |
Alexander Afanasyev | 8566f45 | 2012-12-10 15:21:51 -0800 | [diff] [blame] | 72 | */ |
| 73 | class Stats::Fifo : public ContentStoreWithStats<fifo_policy_traits> { }; |
| 74 | |
| 75 | /** |
Alexander Afanasyev | c3cc0b3 | 2012-12-12 18:41:20 -0800 | [diff] [blame] | 76 | * \brief Content Store with stats implementing Random cache replacement policy |
Alexander Afanasyev | 8566f45 | 2012-12-10 15:21:51 -0800 | [diff] [blame] | 77 | */ |
| 78 | class Stats::Random : public ContentStoreWithStats<random_policy_traits> { }; |
| 79 | |
| 80 | #endif |
| 81 | |
| 82 | |
| 83 | } // namespace cs |
| 84 | } // namespace ndn |
| 85 | } // namespace ns3 |