Public Member Functions | List of all members
dynamicgraph::SignalTimeDependent< T, Time > Class Template Reference

A type of signal that enforces a time dependency between other signals, making sure its inputs are up to date on access, using a incrementing time tick as reference. More...

#include <fwd.hh>

Public Member Functions

const T & access (const Time &t1)
 
virtual void addDependency (const SignalBase< Time > &signal)
 
virtual void clearDependencies ()
 
std::ostream & displayDependencies (std::ostream &os, const int depth=-1, std::string space="", std::string next1="", std::string next2="") const
 
virtual Time getPeriodTime () const
 
virtual bool needUpdate (const Time &t) const
 
const T & operator() (const Time &t1)
 
virtual void removeDependency (const SignalBase< Time > &signal)
 
virtual void setPeriodTime (const Time &p)
 
 SignalTimeDependent (boost::function2< T &, T &, Time > t, const SignalArray_const< Time > &sig, std::string name="")
 
 SignalTimeDependent (const SignalArray_const< Time > &arr, std::string name="")
 
 SignalTimeDependent (std::string name="")
 
std::ostream & writeGraph (std::ostream &os) const
 
virtual ~SignalTimeDependent ()
 

Detailed Description

template<class T, class Time>
class dynamicgraph::SignalTimeDependent< T, Time >

A type of signal that enforces a time dependency between other signals, making sure its inputs are up to date on access, using a incrementing time tick as reference.

It works this way. For a given SignalTimeDependent S,

Thus, the value of dependent signals can be accessed quickly and repeatedly through the Signal::accessCopy () function.

An example:

class MyEntity : public Entity {
public:
// Some signal dependencies
SignalPtr<T,int> dep1, dep2;
SignalTimeDependent<T,int> signal;
MyEntity (const std::string& name)
: Entity (name)
, signal (
// Set the function that computes the signal value
boost::bind (&Entity::computeSignal, this, _1, _2),
// Declare the dependencies
dep1 << dep2,
"signalname")
{}
T& computeSignal (T& res, int time)
{
// The accesses below update the signal if necessary.
dep1(time);
dep1.access(time);
dep1.recompute(time);
// If dep1 and dep2 are already up-to-date, for a faster access, use
dep1.accessCopy();
dep2.accessCopy();
// Compute res
return res;
}

Definition at line 58 of file fwd.hh.

Constructor & Destructor Documentation

◆ SignalTimeDependent() [1/3]

template<class T , class Time >
dynamicgraph::SignalTimeDependent< T, Time >::SignalTimeDependent ( std::string  name = "")

Definition at line 102 of file signal-time-dependent.h.

◆ SignalTimeDependent() [2/3]

template<class T , class Time >
dynamicgraph::SignalTimeDependent< T, Time >::SignalTimeDependent ( const SignalArray_const< Time > &  arr,
std::string  name = "" 
)

Definition at line 106 of file signal-time-dependent.h.

◆ SignalTimeDependent() [3/3]

template<class T , class Time >
dynamicgraph::SignalTimeDependent< T, Time >::SignalTimeDependent ( boost::function2< T &, T &, Time >  t,
const SignalArray_const< Time > &  sig,
std::string  name = "" 
)

Definition at line 111 of file signal-time-dependent.h.

◆ ~SignalTimeDependent()

template<class T , class Time >
virtual dynamicgraph::SignalTimeDependent< T, Time >::~SignalTimeDependent ( )
inlinevirtual

Definition at line 75 of file signal-time-dependent.h.

Member Function Documentation

◆ access()

template<class T , class Time >
const T & dynamicgraph::SignalTimeDependent< T, Time >::access ( const Time &  t1)

Definition at line 119 of file signal-time-dependent.h.

◆ addDependency()

template<class T , class Time >
void dynamicgraph::SignalTimeDependent< T, Time >::addDependency ( const SignalBase< Time > &  signal)
virtual

Definition at line 136 of file signal-time-dependent.h.

◆ clearDependencies()

template<class T , class Time >
void dynamicgraph::SignalTimeDependent< T, Time >::clearDependencies
virtual

Definition at line 148 of file signal-time-dependent.h.

◆ displayDependencies()

template<class T , class Time >
std::ostream& dynamicgraph::SignalTimeDependent< T, Time >::displayDependencies ( std::ostream &  os,
const int  depth = -1,
std::string  space = "",
std::string  next1 = "",
std::string  next2 = "" 
) const
inline

Definition at line 86 of file signal-time-dependent.h.

◆ getPeriodTime()

template<class T , class Time >
Time dynamicgraph::SignalTimeDependent< T, Time >::getPeriodTime
virtual

Definition at line 162 of file signal-time-dependent.h.

◆ needUpdate()

template<class T , class Time >
bool dynamicgraph::SignalTimeDependent< T, Time >::needUpdate ( const Time &  t) const
virtual

Definition at line 153 of file signal-time-dependent.h.

◆ operator()()

template<class T , class Time >
const T& dynamicgraph::SignalTimeDependent< T, Time >::operator() ( const Time &  t1)
inline

Definition at line 77 of file signal-time-dependent.h.

◆ removeDependency()

template<class T , class Time >
void dynamicgraph::SignalTimeDependent< T, Time >::removeDependency ( const SignalBase< Time > &  signal)
virtual

Definition at line 142 of file signal-time-dependent.h.

◆ setPeriodTime()

template<class T , class Time >
void dynamicgraph::SignalTimeDependent< T, Time >::setPeriodTime ( const Time &  p)
virtual

Definition at line 158 of file signal-time-dependent.h.

◆ writeGraph()

template<class T , class Time >
std::ostream& dynamicgraph::SignalTimeDependent< T, Time >::writeGraph ( std::ostream &  os) const
inline

Definition at line 84 of file signal-time-dependent.h.


The documentation for this class was generated from the following files:
dynamicgraph::Entity::Entity
Entity(const std::string &name)
Definition: src/dgraph/entity.cpp:33
MyEntity
Definition: tests/pool.cpp:26
compile.name
name
Definition: compile.py:23


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:39