blob: 404028f6695086aeef28c99fbec05aec5b6adfc5 [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 Afanasyev71ed2382012-07-06 11:37:41 -07004 *
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 Afanasyev71ed2382012-07-06 11:37:41 -07007 *
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 Afanasyev71ed2382012-07-06 11:37:41 -070011 *
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 Afanasyev71ed2382012-07-06 11:37:41 -070015 *
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 Afanasyev71ed2382012-07-06 11:37:41 -070019
20#ifndef EMPTY_POLICY_H_
21#define EMPTY_POLICY_H_
22
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070023namespace ns3 {
24namespace ndn {
25namespace ndnSIM {
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070026
Alexander Afanasyev30f60e32012-07-10 14:21:16 -070027/**
28 * @brief Traits for empty (bogus) replacement policy
29 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080030struct empty_policy_traits {
Alexander Afanasyev991a0cc2012-12-10 11:38:19 -080031 /// @brief Name that can be used to identify the policy (for NS-3 object model and logging)
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080032 static std::string
33 GetName()
34 {
35 return "";
36 }
Alexander Afanasyev991a0cc2012-12-10 11:38:19 -080037
Alexander Afanasyev78057c32012-07-06 15:18:46 -070038 typedef void* policy_hook_type;
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070039
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080040 template<class Container>
41 struct container_hook {
42 typedef void* type;
43 };
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070044
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080045 template<class Base, class Container, class Hook>
46 struct policy {
47 struct type {
48 inline type(Base& base)
49 {
50 }
51
52 inline void update(typename Container::iterator)
53 {
54 }
55 inline bool insert(typename Container::iterator)
56 {
57 return true;
58 }
59 inline void
60 lookup(typename Container::iterator item)
61 {
62 }
63 inline void
64 erase(typename Container::iterator item)
65 {
66 }
67 inline void
68 clear()
69 {
70 }
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070071 };
72 };
73};
74
Alexander Afanasyeve77db792012-08-09 11:10:58 -070075} // ndnSIM
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070076} // ndn
Alexander Afanasyeve77db792012-08-09 11:10:58 -070077} // ns3
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070078
79#endif // EMPTY_POLICY_H_