farm-ng-core
farm_ng::Input< TArg > Class Template Reference

A class that represents in Input type to be used in a Component. More...

#include <context.h>

Public Member Functions

 Input (Component const *component, std::string const &name, std::function< void(TArg)> const &f, InputConfig const &config=InputConfig())
 Default constructor, takes its component, its name, a callback function and its configuration. More...
 
 ~Input ()
 Default destructor. More...
 
Input< TArg > & connect (boost::signals2::signal< void(TArg)> &signal)
 Add a connection between the input signal with the internal signal_slot function. More...
 
void send (TArg const &value)
 Call the actual function and send the result through the signal. More...
 
Uri const & uri () const
 Returns the unique uri of the input. More...
 

Detailed Description

template<class TArg>
class farm_ng::Input< TArg >

A class that represents in Input type to be used in a Component.

Constructor & Destructor Documentation

◆ Input()

template<class TArg >
farm_ng::Input< TArg >::Input ( Component const *  component,
std::string const &  name,
std::function< void(TArg)> const &  f,
InputConfig const &  config = InputConfig() 
)
explicit

Default constructor, takes its component, its name, a callback function and its configuration.

Templated Input constructor.

Convention: If the variable name of the input is in_foo_, then name shall be foo.

◆ ~Input()

template<class TArg >
farm_ng::Input< TArg >::~Input ( )
inline

Default destructor.

Member Function Documentation

◆ connect()

template<class TArg >
Input<TArg>& farm_ng::Input< TArg >::connect ( boost::signals2::signal< void(TArg)> &  signal)
inline

Add a connection between the input signal with the internal signal_slot function.

◆ send()

template<class TArg >
void farm_ng::Input< TArg >::send ( TArg const &  value)
inline

Call the actual function and send the result through the signal.

◆ uri()

template<class TArg >
Uri const& farm_ng::Input< TArg >::uri ( ) const
inline

Returns the unique uri of the input.


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