Kea 2.7.5
key_from_key.h
Go to the documentation of this file.
1// Copyright (C) 2013-2024 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
12namespace isc {
13namespace dhcp {
14
44template<typename KeyExtractor1, typename KeyExtractor2>
46public:
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 }
62private:
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
Utility class which cascades two key extractors.
KeyExtractor1::result_type result_type
result_type operator()(T &arg) const
Extract key value from the object hierarchy.
Defines the logger used by the top-level component of kea-lfc.