blob: 3a219fa0469685e0cf231a02890e6b5cb322fa0e [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 Afanasyev2b4c9472012-08-09 15:00:38 -070026
27NS_LOG_COMPONENT_DEFINE ("ndn.cs.ContentStoreImpl");
28
29#define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \
30 static struct X ## type ## templ ## RegistrationClass \
31 { \
32 X ## type ## templ ## RegistrationClass () { \
33 ns3::TypeId tid = type<templ>::GetTypeId (); \
34 tid.GetParent (); \
35 } \
36 } x_ ## type ## templ ## RegistrationVariable
37
38namespace ns3 {
39namespace ndn {
40
41using namespace ndnSIM;
42
43namespace cs {
44
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070045// explicit instantiation and registering
Alexander Afanasyev1cd79ae2012-10-05 22:42:12 -070046/**
47 * @brief ContentStore with LRU cache replacement policy
48 **/
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070049template class ContentStoreImpl<lru_policy_traits>;
Alexander Afanasyev1cd79ae2012-10-05 22:42:12 -070050
51/**
52 * @brief ContentStore with random cache replacement policy
53 **/
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070054template class ContentStoreImpl<random_policy_traits>;
Alexander Afanasyev1cd79ae2012-10-05 22:42:12 -070055
56/**
57 * @brief ContentStore with FIFO cache replacement policy
58 **/
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070059template class ContentStoreImpl<fifo_policy_traits>;
60
61NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, lru_policy_traits);
62NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, random_policy_traits);
63NS_OBJECT_ENSURE_REGISTERED_TEMPL(ContentStoreImpl, fifo_policy_traits);
64
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080065#ifdef DOXYGEN
66// /**
67// * \brief Content Store implementing LRU cache replacement policy
68// */
69class Lru : public ContentStoreImpl<lru_policy_traits> { };
70
71/**
72 * \brief Content Store implementing FIFO cache replacement policy
73 */
74class Fifo : public ContentStoreImpl<fifo_policy_traits> { };
75
76/**
77 * \brief Content Store implementing Random cache replacement policy
78 */
79class Random : public ContentStoreImpl<random_policy_traits> { };
80#endif
81
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070082
83} // namespace cs
84} // namespace ndn
85} // namespace ns3