Kea 2.7.5
isc::dhcp::KeyFromKeyExtractor< KeyExtractor1, KeyExtractor2 > Class Template Reference

Utility class which cascades two key extractors. More...

#include <key_from_key.h>

Public Types

typedef KeyExtractor1::result_type result_type
 

Public Member Functions

 KeyFromKeyExtractor ()
 Constructor.
 
template<typename T >
result_type operator() (T &arg) const
 Extract key value from the object hierarchy.
 

Detailed Description

template<typename KeyExtractor1, typename KeyExtractor2>
class isc::dhcp::KeyFromKeyExtractor< KeyExtractor1, KeyExtractor2 >

Utility class which cascades two key extractors.

The key extractor (a.k.a. key extraction class) is used by the key-based indices to obtain the indexing keys from the elements of a multi_index_container. The standard key extractors can be used to retrieve indexing key values by accessing members or methods exposed by the elements (objects or structures) stored in a multi_index_container. For example, if a container holds objects of type A, then the public members of object A or its accessors can be used by the standard extractor classes such as "member" or "const_mem_fun" respectively. Assume more complex scenario, where multi_index_container holds objects of a type A, object A exposes its public member B, which in turn exposes the accessor function returning object C. One may want to use the value C (e.g. integer) to index objects A in the container. This can't be solved by using standard key extractors because object C is nested in B and thus it is not directly accessible from A. However, it is possible to specify two distinct key extractors, one used to extract value C from B, another one to extract value B from A. These two extractors can be then wrapped by another key extractor which can be used to obtain index key C from object A. This key extractor is implemented as a functor class. The functor calls functors specified as template parameters to retrieve the index value from the cascaded structure.

Template Parameters
KeyExtractor1extractor used to extract the key value from the object containing it.
KeyExtractor2extractor used to extract the nested object containing a key.

Definition at line 45 of file key_from_key.h.

Member Typedef Documentation

◆ result_type

template<typename KeyExtractor1 , typename KeyExtractor2 >
typedef KeyExtractor1::result_type isc::dhcp::KeyFromKeyExtractor< KeyExtractor1, KeyExtractor2 >::result_type

Definition at line 47 of file key_from_key.h.

Constructor & Destructor Documentation

◆ KeyFromKeyExtractor()

template<typename KeyExtractor1 , typename KeyExtractor2 >
isc::dhcp::KeyFromKeyExtractor< KeyExtractor1, KeyExtractor2 >::KeyFromKeyExtractor ( )
inline

Constructor.

Definition at line 50 of file key_from_key.h.

Member Function Documentation

◆ operator()()

template<typename KeyExtractor1 , typename KeyExtractor2 >
template<typename T >
result_type isc::dhcp::KeyFromKeyExtractor< KeyExtractor1, KeyExtractor2 >::operator() ( T & arg) const
inline

Extract key value from the object hierarchy.

Parameters
argthe key value.
Template Parameters
keyvalue type.

Definition at line 59 of file key_from_key.h.


The documentation for this class was generated from the following file: