Anchors
C++ library for Incremental Computing
anchors::Anchor< T, InputType1, InputType2 > Class Template Reference

A single node in the computation graph containing a value. More...

#include <anchor.h>

Inheritance diagram for anchors::Anchor< T, InputType1, InputType2 >:
[legend]
Collaboration diagram for anchors::Anchor< T, InputType1, InputType2 >:
[legend]

Public Types

using SingleInputUpdater = std::function< T(InputType1 &)>
 Alias for function that accepts an input of type InputType1 and returns a value of type T.
 
using DualInputUpdater = std::function< T(InputType1 &, InputType2 &)>
 Alias for function that accepts inputs of type InputType1 and InputType2 and returns a value of type T.
 

Public Member Functions

 Anchor (const T &value)
 Creates an Anchor. More...
 
 Anchor (const std::shared_ptr< AnchorWrap< InputType1 > > &input, const SingleInputUpdater &updater)
 Creates an Anchor from an input Anchor. More...
 
 Anchor (const std::shared_ptr< AnchorWrap< InputType1 > > &firstInput, const std::shared_ptr< AnchorWrap< InputType2 > > &secondInput, const DualInputUpdater &updater)
 Creates an Anchor from two input Anchors. More...
 

Detailed Description

template<typename T, typename InputType1 = T, typename InputType2 = T>
class anchors::Anchor< T, InputType1, InputType2 >

A single node in the computation graph containing a value.

Template Parameters
T- type of the Anchor's value
InputType1- optional type of the first input Anchor, if applicable.
InputType2- optional type of the second input Anchor, if applicable.

Constructor & Destructor Documentation

◆ Anchor() [1/3]

template<typename T , typename InputType1 , typename InputType2 >
anchors::Anchor< T, InputType1, InputType2 >::Anchor ( const T &  value)
explicit

Creates an Anchor.

See Anchors::create(const T& value)

Parameters
value- initial value of the Anchor

◆ Anchor() [2/3]

template<typename T , typename InputType1 , typename InputType2 >
anchors::Anchor< T, InputType1, InputType2 >::Anchor ( const std::shared_ptr< AnchorWrap< InputType1 > > &  input,
const SingleInputUpdater updater 
)
explicit

Creates an Anchor from an input Anchor.

See Anchors::map()

Parameters
input- input Anchor.
updater- function that maps the input Anchor to the output.

◆ Anchor() [3/3]

template<typename T , typename InputType1 , typename InputType2 >
anchors::Anchor< T, InputType1, InputType2 >::Anchor ( const std::shared_ptr< AnchorWrap< InputType1 > > &  firstInput,
const std::shared_ptr< AnchorWrap< InputType2 > > &  secondInput,
const DualInputUpdater updater 
)
explicit

Creates an Anchor from two input Anchors.

See Anchors::map2()

Parameters
firstInput- first input Anchor.
secondInput- second input Anchor.
updater- function that maps the input Anchors to the output.

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