blob: 0cfe96227cce79ad4b13304a8b900d788e51fcbd [file] [log] [blame]
Jeff Thompsonfa306642013-06-17 15:06:57 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Alexander Afanasyev
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
9 */
10
11#ifndef EMPTY_POLICY_H_
12#define EMPTY_POLICY_H_
13
14namespace ndn {
15namespace trie {
16
17/**
18 * @brief Traits for empty (bogus) replacement policy
19 */
20struct empty_policy_traits
21{
22 /// @brief Name that can be used to identify the policy (e.g., for logging)
23 static std::string GetName () { return ""; }
24
25 typedef void* policy_hook_type;
26
27 template<class Container> struct container_hook { typedef void* type; };
28
29 template<class Base,
30 class Container,
31 class Hook>
32 struct policy
33 {
34 struct type
35 {
36 inline type (Base &base) {}
37
38 inline void update (typename Container::iterator) { }
39 inline bool insert (typename Container::iterator) { return true; }
40 inline void lookup (typename Container::iterator item) { }
41 inline void erase (typename Container::iterator item) { }
42 inline void clear () { }
43 };
44 };
45};
46
47} // trie
48} // ndn
49
50#endif // EMPTY_POLICY_H_