Kea  1.9.9-git
key_from_key.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef KEY_FROM_KEY_H
8 #define KEY_FROM_KEY_H
9 
10 #include <functional>
11 
12 namespace isc {
13 namespace dhcp {
14 
44 template<typename KeyExtractor1, typename KeyExtractor2>
46 public:
47  typedef typename KeyExtractor1::result_type result_type;
48 
51  : key1_(KeyExtractor1()), key2_(KeyExtractor2()) { };
52 
58  template<typename T>
59  result_type operator() (T& arg) const {
60  return (key1_(key2_(arg)));
61  }
62 private:
65  KeyExtractor1 key1_;
68  KeyExtractor2 key2_;
69 };
70 
71 } // end of isc::dhcp namespace
72 } // end of isc namespace
73 
74 #endif // KEY_FROM_KEY_H
KeyExtractor1::result_type result_type
Definition: key_from_key.h:47
Defines the logger used by the top-level component of kea-dhcp-ddns.
KeyFromKeyExtractor()
Constructor.
Definition: key_from_key.h:50
result_type operator()(T &arg) const
Extract key value from the object hierarchy.
Definition: key_from_key.h:59
Utility class which cascades two key extractors.
Definition: key_from_key.h:45