orbtree
Public Types | Public Member Functions | Public Attributes | List of all members
orbtree::NVFunc_Adapter_Simple< NVFunc > Struct Template Reference

Adapter for functions that return only one result. This class also describes the interface expected for the NVFunc template parameter for the tree / set / map classes. More...

#include <orbtree.h>

Public Types

typedef NVFunc::result_type result_type
 Type of the result of this function.
 

Public Member Functions

constexpr unsigned int get_nr () const
 Dimension of result. In case of a simple function, it is one. More...
 
void operator() (const typename NVFunc::argument_type &node_value, result_type *res) const
 Calculate the function value associated with one node. More...
 
 NVFunc_Adapter_Simple (const NVFunc &f_)
 Create a new instance storing the given function.
 
 NVFunc_Adapter_Simple (NVFunc &&f_)
 
template<class T >
 NVFunc_Adapter_Simple (const T &t)
 

Public Attributes

NVFunc f
 

Detailed Description

template<class NVFunc>
struct orbtree::NVFunc_Adapter_Simple< NVFunc >

Adapter for functions that return only one result. This class also describes the interface expected for the NVFunc template parameter for the tree / set / map classes.

Template Parameters
NVFuncsimple function taking one argument and returning the associated value to be stored. Should define a member type as argument_type to use this adapter.

Member Function Documentation

◆ get_nr()

template<class NVFunc >
constexpr unsigned int orbtree::NVFunc_Adapter_Simple< NVFunc >::get_nr ( ) const
inline

Dimension of result. In case of a simple function, it is one.

Main use case: for a function that has an adjustable parameter, it can be used as a vector function and results for multiple parameter combinations can be calculated at the same time.

◆ operator()()

template<class NVFunc >
void orbtree::NVFunc_Adapter_Simple< NVFunc >::operator() ( const typename NVFunc::argument_type &  node_value,
result_type res 
) const
inline

Calculate the function value associated with one node.

Parameters
node_valueNode's value, i.e. the key in case of a set or multiset, and a pair of key and value for a map or multimap
resresult is stored here (should be an array of size at least the number returned by get_nr()

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