Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [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-impl.h" |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 22 | |
Alexander Afanasyev | 1a2df6a | 2012-08-17 13:21:51 -0700 | [diff] [blame] | 23 | #include "../../utils/trie/random-policy.h" |
| 24 | #include "../../utils/trie/lru-policy.h" |
| 25 | #include "../../utils/trie/fifo-policy.h" |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 26 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 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 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 43 | // explicit instantiation and registering |
Alexander Afanasyev | 1cd79ae | 2012-10-05 22:42:12 -0700 | [diff] [blame] | 44 | /** |
| 45 | * @brief ContentStore with LRU cache replacement policy |
| 46 | **/ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 47 | template class ContentStoreImpl<lru_policy_traits>; |
Alexander Afanasyev | 1cd79ae | 2012-10-05 22:42:12 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * @brief ContentStore with random cache replacement policy |
| 51 | **/ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 52 | template class ContentStoreImpl<random_policy_traits>; |
Alexander Afanasyev | 1cd79ae | 2012-10-05 22:42:12 -0700 | [diff] [blame] | 53 | |
| 54 | /** |
| 55 | * @brief ContentStore with FIFO cache replacement policy |
| 56 | **/ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 57 | template class ContentStoreImpl<fifo_policy_traits>; |
| 58 | |
| 59 | NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, lru_policy_traits); |
| 60 | NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, random_policy_traits); |
| 61 | NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, fifo_policy_traits); |
| 62 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 63 | #ifdef DOXYGEN |
| 64 | // /** |
| 65 | // * \brief Content Store implementing LRU cache replacement policy |
| 66 | // */ |
| 67 | class Lru : public ContentStoreImpl<lru_policy_traits> { }; |
| 68 | |
| 69 | /** |
| 70 | * \brief Content Store implementing FIFO cache replacement policy |
| 71 | */ |
| 72 | class Fifo : public ContentStoreImpl<fifo_policy_traits> { }; |
| 73 | |
| 74 | /** |
| 75 | * \brief Content Store implementing Random cache replacement policy |
| 76 | */ |
| 77 | class Random : public ContentStoreImpl<random_policy_traits> { }; |
| 78 | #endif |
| 79 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 80 | |
| 81 | } // namespace cs |
| 82 | } // namespace ndn |
| 83 | } // namespace ns3 |