Anchors
C++ library for Incremental Computing
anchors::Anchors Class Reference

Anchors is an utility class containing functions to simplify creating a shared pointer to an Anchor, which the Engine class operates on. More...

#include <anchorutil.h>

Static Public Member Functions

template<typename T >
static AnchorPtr< T > create (const T &value)
 Creates an Anchor containing the given value. More...
 
template<typename T , typename InputType1 = T>
static AnchorPtr< T > map (const AnchorPtr< InputType1 > &anchor, const typename Anchor< T, InputType1 >::SingleInputUpdater &updater)
 Creates an Anchor from an input Anchor. More...
 
template<typename T , typename InputType1 = T, typename InputType2 = T>
static AnchorPtr< T > map2 (const AnchorPtr< InputType1 > &anchor1, const AnchorPtr< InputType2 > &anchor2, const typename Anchor< T, InputType1, InputType2 >::DualInputUpdater &updater)
 Creates an Anchor from two input Anchors. More...
 
template<typename T , typename InputType1 = T, typename InputType2 = T, typename InputType3 = T>
static AnchorPtr< T > map3 (const AnchorPtr< InputType1 > &anchor1, const AnchorPtr< InputType2 > &anchor2, const AnchorPtr< InputType3 > &anchor3, const std::function< T(InputType1 &, InputType2 &, InputType3 &)> &updater)
 Creates an Anchor from three input Anchors. More...
 
template<typename T , typename InputType1 = T, typename InputType2 = T, typename InputType3 = T, typename InputType4 = T>
static AnchorPtr< T > map4 (const AnchorPtr< InputType1 > &anchor1, const AnchorPtr< InputType2 > &anchor2, const AnchorPtr< InputType3 > &anchor3, const AnchorPtr< InputType4 > &anchor4, const std::function< T(InputType1 &, InputType2 &, InputType3 &, InputType4 &)> &updater)
 Creates an Anchor from four input Anchors. More...
 

Detailed Description

Anchors is an utility class containing functions to simplify creating a shared pointer to an Anchor, which the Engine class operates on.

To create shared pointers with custom allocators, you can invoke the public constructors in the Anchor class.

Member Function Documentation

◆ create()

template<typename T >
AnchorPtr< T > anchors::Anchors::create ( const T &  value)
static

Creates an Anchor containing the given value.

Template Parameters
T- Anchor type. T should overload the equality and output operators if not already defined.
Parameters
value- initial value of the Anchor.
Returns
a shared pointer to the created Anchor.

◆ map()

template<typename T , typename InputType1 >
AnchorPtr< T > anchors::Anchors::map ( const AnchorPtr< InputType1 > &  anchor,
const typename Anchor< T, InputType1 >::SingleInputUpdater &  updater 
)
static

Creates an Anchor from an input Anchor.

Template Parameters
T- type of the output Anchor. T should overload the equality and output operators if not already defined.
InputType1- optional type of the input Anchor. Required only if this type is different from the output Anchor Type T.
Parameters
anchor- input Anchor
updater- function that maps the input Anchor to the output.
Returns
a shared pointer to the created Anchor

◆ map2()

template<typename T , typename InputType1 , typename InputType2 >
AnchorPtr< T > anchors::Anchors::map2 ( const AnchorPtr< InputType1 > &  anchor1,
const AnchorPtr< InputType2 > &  anchor2,
const typename Anchor< T, InputType1, InputType2 >::DualInputUpdater &  updater 
)
static

Creates an Anchor from two input Anchors.

Template Parameters
T- type of the output Anchor. T should overload the equality and output operators if not already defined.
InputType1- optional type of the first input Anchor. Required only if this type is different from the output Anchor Type T.
InputType2- optional type of the second input Anchor. Required only if this type is different from the output Anchor Type T.
Parameters
anchor1- first input Anchor.
anchor2- second input Anchor.
updater- function that maps the input Anchors to the output.
Returns
a shared pointer to the created Anchor.

◆ map3()

template<typename T , typename InputType1 , typename InputType2 , typename InputType3 >
AnchorPtr< T > anchors::Anchors::map3 ( const AnchorPtr< InputType1 > &  anchor1,
const AnchorPtr< InputType2 > &  anchor2,
const AnchorPtr< InputType3 > &  anchor3,
const std::function< T(InputType1 &, InputType2 &, InputType3 &)> &  updater 
)
static

Creates an Anchor from three input Anchors.

Template Parameters
T- type of the output Anchor. T should overload the equality and output operators if not already defined.
InputType1- optional type of the first input Anchor. Required only if this type is different from the output Anchor Type T.
InputType2- optional type of the second input Anchor. Required only if this type is different from the output Anchor Type T.
InputType3- optional type of the third input Anchor. Required only if this type is different from the output Anchor Type T.
Parameters
anchor1- first input Anchor.
anchor2- second input Anchor.
anchor3- third input Anchor.
updater- function that maps the input Anchors to the output.
Returns
a shared pointer to the created Anchor

◆ map4()

template<typename T , typename InputType1 , typename InputType2 , typename InputType3 , typename InputType4 >
AnchorPtr< T > anchors::Anchors::map4 ( const AnchorPtr< InputType1 > &  anchor1,
const AnchorPtr< InputType2 > &  anchor2,
const AnchorPtr< InputType3 > &  anchor3,
const AnchorPtr< InputType4 > &  anchor4,
const std::function< T(InputType1 &, InputType2 &, InputType3 &, InputType4 &)> &  updater 
)
static

Creates an Anchor from four input Anchors.

Template Parameters
T- type of the output Anchor. T should overload the equality and output operators if not already defined.
InputType1- optional type of the first input Anchor. Required only if this type is different from the output Anchor Type T.
InputType2- optional type of the second input Anchor. Required only if this type is different from the output Anchor Type T.
InputType3- optional type of the third input Anchor. Required only if this type is different from the output Anchor Type T.
InputType4- optional type of the fourth input Anchor. Required only if this type is different from the output Anchor Type T.
Parameters
anchor1- first input Anchor.
anchor2- second input Anchor.
anchor3- third input Anchor.
anchor4- fourth input Anchor.
updater- function that maps the input Anchors to the output.
Returns
a shared pointer to the created Anchor

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