dynamic-graph  4.1.0-8-gdab7-dirty
Dynamic graph library
Entity Class Reference

This class represents an entity, i.e. a generic computational unit that provides input and output signals. More...

#include <dynamic-graph/entity.h>

Inheritance diagram for Entity:
Collaboration diagram for Entity:

Public Types

typedef std::map< const std::string, command::Command * > CommandMap_t
 
typedef std::map< std::string, SignalBase< int > * > SignalMap
 

Public Member Functions

 Entity (const std::string &name)
 
virtual void display (std::ostream &os) const
 Display information on the entity inside the output stream os.
 
std::ostream & displaySignalList (std::ostream &os) const
 Display the list of signals of this entity in output stream os. More...
 
virtual const std::string & getClassName () const
 
const std::string & getCommandList () const
 
virtual std::string getDocString () const
 Returns the Entity documentation. More...
 
const std::string & getName () const
 
command::CommandgetNewStyleCommand (const std::string &cmdName)
 Provides the pointer towards the Command object cmdName. More...
 
CommandMap_t getNewStyleCommandMap ()
 Provides the std::map where all the commands are registered. More...
 
SignalBase< int > & getSignal (const std::string &signalName)
 Provides a reference to the signal named signalName. More...
 
const SignalBase< int > & getSignal (const std::string &signalName) const
 Provides a const reference to the signal named signalName. More...
 
SignalMap getSignalMap () const
 Provides a map of all the signals. More...
 
bool hasSignal (const std::string &signame) const
 Test if a signal of name signame is present. More...
 
virtual SignalBase< int > * test ()
 
virtual void test2 (SignalBase< int > *)
 
virtual std::ostream & writeCompletionList (std::ostream &os) const
 This method is used write in the output stream os the signals names and the commands of the entity. More...
 
virtual std::ostream & writeGraph (std::ostream &os) const
 This method is used to write down in os the edges of the graph by calling the signals writeGraph method. More...
 
Logger related methods
Loggerlogger ()
 
Logger const & logger () const
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const std::string &lineId="")
 Send messages msg with level t. Add string file and line to message.
 
void setLoggerVerbosityLevel (LoggerVerbosity lv)
 Specify the verbosity level of the logger.
 
LoggerVerbosity getLoggerVerbosityLevel ()
 Get the logger's verbosity level.
 
bool setTimeSample (double t)
 Set the time sample.
 
double getTimeSample ()
 Get the time sample.
 
bool setStreamPrintPeriod (double t)
 Set the period of the stream period.
 
double getStreamPrintPeriod ()
 Get the period of the stream period.
 

Protected Member Functions

void addCommand (const std::string &name, command::Command *command)
 
void entityDeregistration ()
 
void entityRegistration ()
 
void signalDeregistration (const std::string &name)
 
void signalRegistration (const SignalArray< int > &signals)
 

Protected Attributes

CommandMap_t commandMap
 
Logger logger_
 
std::string name
 
SignalMap signalMap
 

Detailed Description

This class represents an entity, i.e. a generic computational unit that provides input and output signals.

These signals link the entities together to form a complete computation graph. To declare a new entity, please see the DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN macro in factory.h.

Definition at line 53 of file entity.h.

Member Function Documentation

◆ displaySignalList()

std::ostream& displaySignalList ( std::ostream &  os) const

Display the list of signals of this entity in output stream os.

Parameters
osthe output stream where to display the list of signals.
Returns
The output stream given in parameter.

◆ getDocString()

virtual std::string getDocString ( ) const
virtual

Returns the Entity documentation.

Returns
The documentation is provided as std::string object.

◆ getNewStyleCommand()

command::Command* getNewStyleCommand ( const std::string &  cmdName)

Provides the pointer towards the Command object cmdName.

Parameters
cmdNameName of the command

◆ getNewStyleCommandMap()

CommandMap_t getNewStyleCommandMap ( )

Provides the std::map where all the commands are registered.

Returns
A map of pointers towards Command objects

◆ getSignal() [1/2]

SignalBase<int>& getSignal ( const std::string &  signalName)

Provides a reference to the signal named signalName.

Parameters
signalNameName of the signal
Returns
A reference to the signal with a temporal dependency.

◆ getSignal() [2/2]

const SignalBase<int>& getSignal ( const std::string &  signalName) const

Provides a const reference to the signal named signalName.

Parameters
signalNameName of the signal
Returns
A const reference to the signal with a temporal dependency.

◆ getSignalMap()

SignalMap getSignalMap ( ) const

Provides a map of all the signals.

Returns
A copy of the map with all the pointers towards the entity signals.

◆ hasSignal()

bool hasSignal ( const std::string &  signame) const

Test if a signal of name signame is present.

Returns
True if the signal is present, False otherwise

◆ writeCompletionList()

virtual std::ostream& writeCompletionList ( std::ostream &  os) const
virtual

This method is used write in the output stream os the signals names and the commands of the entity.

Parameters
osThe output stream where to write the list of objects related to the entity.

◆ writeGraph()

virtual std::ostream& writeGraph ( std::ostream &  os) const
virtual

This method is used to write down in os the edges of the graph by calling the signals writeGraph method.

Parameters
osThe output stream where to write the informations.
Returns
os: The output stream.

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