blob: 237a6474012ea8fe4cdcc3f71788a45e01f6ef4f [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
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080023/// @cond include_hidden
24
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070025namespace ns3 {
26namespace ndn {
27namespace ndnSIM {
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070028
Alexander Afanasyev30f60e32012-07-10 14:21:16 -070029/**
30 * @brief Traits for empty (bogus) replacement policy
31 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080032struct empty_policy_traits {
Alexander Afanasyev991a0cc2012-12-10 11:38:19 -080033 /// @brief Name that can be used to identify the policy (for NS-3 object model and logging)
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080034 static std::string
35 GetName()
36 {
37 return "";
38 }
Alexander Afanasyev991a0cc2012-12-10 11:38:19 -080039
Alexander Afanasyev78057c32012-07-06 15:18:46 -070040 typedef void* policy_hook_type;
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070041
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080042 template<class Container>
43 struct container_hook {
44 typedef void* type;
45 };
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070046
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080047 template<class Base, class Container, class Hook>
48 struct policy {
49 struct type {
50 inline type(Base& base)
51 {
52 }
53
54 inline void update(typename Container::iterator)
55 {
56 }
57 inline bool insert(typename Container::iterator)
58 {
59 return true;
60 }
61 inline void
62 lookup(typename Container::iterator item)
63 {
64 }
65 inline void
66 erase(typename Container::iterator item)
67 {
68 }
69 inline void
70 clear()
71 {
72 }
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070073 };
74 };
75};
76
Alexander Afanasyeve77db792012-08-09 11:10:58 -070077} // ndnSIM
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070078} // ndn
Alexander Afanasyeve77db792012-08-09 11:10:58 -070079} // ns3
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070080
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080081/// @endcond
82
Alexander Afanasyev71ed2382012-07-06 11:37:41 -070083#endif // EMPTY_POLICY_H_