dynamic-graph  4.1.0-8-gdab7-dirty
Dynamic graph library
SignalPtr< T, Time > Class Template Reference

This is the only type of signal that can be plugged to, using the plug () command. More...

#include <dynamic-graph/signal-ptr.h>

Inheritance diagram for SignalPtr< T, Time >:
Collaboration diagram for SignalPtr< T, Time >:

Public Member Functions

 SignalPtr (Signal< T, Time > *ptr, std::string name="")
 
virtual const T & access (const Time &t)
 
virtual const T & accessCopy () const
 
virtual void checkCompatibility ()
 
virtual std::ostream & display (std::ostream &os) const
 
virtual std::ostream & displayDependencies (std::ostream &os, const int depth=-1, std::string space="", std::string next1="", std::string next2="") const
 
SignalBase< Time > * getAbstractPtr ()
 
const SignalBase< Time > * getAbstractPtr () const
 
virtual SignalBase< Time > * getPluged () const
 
Signal< T, Time > * getPtr ()
 
const Signal< T, Time > * getPtr () const
 
virtual const Time & getTime () const
 
virtual bool isAbstractPluged () const
 
virtual bool isPlugged () const
 
virtual bool needUpdate (const Time &t) const
 
 operator bool () const
 
virtual const T & operator() (const Time &t)
 
Signal< T, Time > & operator* ()
 
const Signal< T, Time > & operator* () const
 
Signal< T, Time > * operator-> ()
 
const Signal< T, Time > * operator-> () const
 
virtual Signal< T, Time > & operator= (const T &t)
 
virtual void plug (SignalBase< Time > *ref)
 
virtual void setConstant (const T &t)
 
void setConstantDefault (const T &t)
 
virtual void setConstantDefault ()
 
virtual void setFunction (boost::function2< T &, T &, Time > t, typename Signal< T, Time >::Mutex *m=NULL)
 
virtual void setReference (const T *t, typename Signal< T, Time >::Mutex *m=NULL)
 
virtual void unplug ()
 
void unsetConstantDefault ()
 
virtual std::ostream & writeGraph (std::ostream &os) const
 
- Public Member Functions inherited from Signal< T, Time >
 Signal (std::string name)
 
virtual void get (std::ostream &value) const
 
virtual void getClassName (std::string &aClassName) const
 
bool getKeepReference ()
 
 operator const T & () const
 
virtual void recompute (const Time &t)
 
virtual void set (std::istringstream &value)
 
virtual void setFunction (boost::function2< T &, T &, Time > t, Mutex *mutexref=NULL)
 
void setKeepReference (const bool &b)
 
virtual void setReference (const T *t, Mutex *mutexref=NULL)
 
virtual void setReferenceNonConstant (T *t, Mutex *mutexref=NULL)
 
virtual void trace (std::ostream &os) const
 
- Public Member Functions inherited from SignalBase< Time >
 SignalBase (std::string name="")
 
virtual void setTime (const Time &t)
 
const bool & getReady () const
 
const std::string & getName () const
 
void getClassName (std::string &aClassName) const
 
virtual void setPeriodTime (const Time &)
 
virtual Time getPeriodTime () const
 
virtual void addDependency (const SignalBase< Time > &)
 
virtual void removeDependency (const SignalBase< Time > &)
 
void setReady (const bool sready=true)
 
std::string shortName () const
 
virtual void ExtractNodeAndLocalNames (std::string &LocalName, std::string &NodeName) const
 

Protected Member Functions

virtual void addDependency ()
 
bool autoref () const
 
virtual void clearDependencies ()
 
virtual void removeDependency ()
 

Protected Attributes

SignalBase< Time > * abstractTransmitter
 
bool modeNoThrow
 
Signal< T, Time > * signalPtr
 
bool transmitAbstract
 
T * transmitAbstractData
 
- Protected Attributes inherited from Signal< T, Time >
bool copyInit
 
bool keepReference
 
Mutex * providerMutex
 
SignalType signalType
 
T * Tcopy
 
Tcopy1
 
Tcopy2
 
boost::function2< T &, T &, Time > Tfunction
 
const T * Treference
 
T * TreferenceNonConst
 
- Protected Attributes inherited from SignalBase< Time >
std::string name
 
bool ready
 
Time signalTime
 

Additional Inherited Members

- Public Types inherited from Signal< T, Time >
typedef int * Mutex
 
typedef int * MutexError
 
- Protected Types inherited from Signal< T, Time >
enum  SignalType { CONSTANT, REFERENCE, REFERENCE_NON_CONST, FUNCTION }
 
- Static Protected Attributes inherited from Signal< T, Time >
static const bool KEEP_REFERENCE_DEFAULT = false
 
static const SignalType SIGNAL_TYPE_DEFAULT = CONSTANT
 

Detailed Description

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

This is the only type of signal that can be plugged to, using the plug () command.

In that sense, when plugged into, it acts as a "pointer" to the input signal, hence the name. Operator -> is also overloaded and can be used to access the pointed signal.

If the signal provided as a parameter of the plug operation cannot be casted in type T, but is compatible then the class holds a reference to an abstract object.

Definition at line 42 of file fwd.hh.

Member Function Documentation

◆ checkCompatibility()

void checkCompatibility ( )
virtual

checkCompatibility is used to get the object contained in the signal. This used to verify if a dynamic cast is possible or not.

Reimplemented from Signal< T, Time >.

Definition at line 113 of file signal-ptr.t.cpp.


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