Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dynamicgraph::Entity Class Reference

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

#include <entity.h>

Inheritance diagram for dynamicgraph::Entity:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

virtual void display (std::ostream &os) const
 Display information on the entity inside the output stream os. More...
 
std::ostream & displaySignalList (std::ostream &os) const
 Display the list of signals of this entity in output stream os. More...
 
 Entity (const std::string &name)
 
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...
 
virtual ~Entity ()
 
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. More...
 
void setLoggerVerbosityLevel (LoggerVerbosity lv)
 Specify the verbosity level of the logger. More...
 
LoggerVerbosity getLoggerVerbosityLevel ()
 Get the logger's verbosity level. More...
 
bool setTimeSample (double t)
 Set the time sample. More...
 
double getTimeSample ()
 Get the time sample. More...
 
bool setStreamPrintPeriod (double t)
 Set the period of the stream period. More...
 
double getStreamPrintPeriod ()
 Get the period of the stream period. More...
 

Protected Member Functions

void addCommand (const std::string &name, command::Command *command)
 Add a command to Entity. More...
 
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 52 of file include/dynamic-graph/entity.h.

Member Typedef Documentation

◆ CommandMap_t

typedef std::map<const std::string, command::Command *> dynamicgraph::Entity::CommandMap_t

Definition at line 55 of file include/dynamic-graph/entity.h.

◆ SignalMap

typedef std::map<std::string, SignalBase<int> *> dynamicgraph::Entity::SignalMap

Definition at line 54 of file include/dynamic-graph/entity.h.

Constructor & Destructor Documentation

◆ Entity()

Entity::Entity ( const std::string &  name)
explicit

Definition at line 33 of file src/dgraph/entity.cpp.

◆ ~Entity()

Entity::~Entity ( )
virtual

Definition at line 47 of file src/dgraph/entity.cpp.

Member Function Documentation

◆ addCommand()

void Entity::addCommand ( const std::string &  name,
command::Command command 
)
protected

Add a command to Entity.

Definition at line 187 of file src/dgraph/entity.cpp.

◆ display()

void Entity::display ( std::ostream &  os) const
virtual

Display information on the entity inside the output stream os.

Reimplemented in dynamicgraph::Tracer, dynamicgraph::MyEntity, dynamicgraph::TracerRealTime, MyEntity, and CustomEntity.

Definition at line 166 of file src/dgraph/entity.cpp.

◆ displaySignalList()

std::ostream & Entity::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.

Definition at line 131 of file src/dgraph/entity.cpp.

◆ entityDeregistration()

void Entity::entityDeregistration ( )
protected

Definition at line 29 of file src/dgraph/entity.cpp.

◆ entityRegistration()

void Entity::entityRegistration ( )
protected

Definition at line 25 of file src/dgraph/entity.cpp.

◆ getClassName()

virtual const std::string& dynamicgraph::Entity::getClassName ( ) const
inlinevirtual

◆ getCommandList()

const std::string & Entity::getCommandList ( ) const

Definition at line 182 of file src/dgraph/entity.cpp.

◆ getDocString()

std::string Entity::getDocString ( ) const
virtual

Returns the Entity documentation.

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

Definition at line 104 of file src/dgraph/entity.cpp.

◆ getLoggerVerbosityLevel()

LoggerVerbosity dynamicgraph::Entity::getLoggerVerbosityLevel ( )
inline

Get the logger's verbosity level.

Definition at line 147 of file include/dynamic-graph/entity.h.

◆ getName()

const std::string& dynamicgraph::Entity::getName ( ) const
inline

Definition at line 60 of file include/dynamic-graph/entity.h.

◆ getNewStyleCommand()

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

Provides the pointer towards the Command object cmdName.

Parameters
cmdNameName of the command

Definition at line 202 of file src/dgraph/entity.cpp.

◆ getNewStyleCommandMap()

std::map< const std::string, Command * > Entity::getNewStyleCommandMap ( )

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

Return the list of command objects.

Returns
A map of pointers towards Command objects

Definition at line 198 of file src/dgraph/entity.cpp.

◆ getSignal() [1/2]

SignalBase<int>& dynamicgraph::Entity::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>& dynamicgraph::Entity::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()

Entity::SignalMap Entity::getSignalMap ( ) const

Provides a map of all the signals.

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

Definition at line 175 of file src/dgraph/entity.cpp.

◆ getStreamPrintPeriod()

double dynamicgraph::Entity::getStreamPrintPeriod ( )
inline

Get the period of the stream period.

Definition at line 161 of file include/dynamic-graph/entity.h.

◆ getTimeSample()

double dynamicgraph::Entity::getTimeSample ( )
inline

Get the time sample.

Definition at line 153 of file include/dynamic-graph/entity.h.

◆ hasSignal()

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

Test if a signal of name signame is present.

Returns
True if the signal is present, False otherwise

Definition at line 119 of file src/dgraph/entity.cpp.

◆ logger() [1/2]

Logger& dynamicgraph::Entity::logger ( )
inline

Definition at line 135 of file include/dynamic-graph/entity.h.

◆ logger() [2/2]

Logger const& dynamicgraph::Entity::logger ( ) const
inline

Definition at line 136 of file include/dynamic-graph/entity.h.

◆ sendMsg()

void Entity::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.

Definition at line 211 of file src/dgraph/entity.cpp.

◆ setLoggerVerbosityLevel()

void dynamicgraph::Entity::setLoggerVerbosityLevel ( LoggerVerbosity  lv)
inline

Specify the verbosity level of the logger.

Definition at line 144 of file include/dynamic-graph/entity.h.

◆ setStreamPrintPeriod()

bool dynamicgraph::Entity::setStreamPrintPeriod ( double  t)
inline

Set the period of the stream period.

Definition at line 156 of file include/dynamic-graph/entity.h.

◆ setTimeSample()

bool dynamicgraph::Entity::setTimeSample ( double  t)
inline

Set the time sample.

Definition at line 150 of file include/dynamic-graph/entity.h.

◆ signalDeregistration()

void Entity::signalDeregistration ( const std::string &  name)
protected

Definition at line 89 of file src/dgraph/entity.cpp.

◆ signalRegistration()

void Entity::signalRegistration ( const SignalArray< int > &  signals)
protected

Definition at line 59 of file src/dgraph/entity.cpp.

◆ test()

virtual SignalBase<int>* dynamicgraph::Entity::test ( )
inlinevirtual

Definition at line 111 of file include/dynamic-graph/entity.h.

◆ test2()

virtual void dynamicgraph::Entity::test2 ( SignalBase< int > *  )
inlinevirtual

Definition at line 113 of file include/dynamic-graph/entity.h.

◆ writeCompletionList()

std::ostream & Entity::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.

Definition at line 155 of file src/dgraph/entity.cpp.

◆ writeGraph()

std::ostream & Entity::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.

Definition at line 146 of file src/dgraph/entity.cpp.

Member Data Documentation

◆ commandMap

CommandMap_t dynamicgraph::Entity::commandMap
protected

Definition at line 176 of file include/dynamic-graph/entity.h.

◆ logger_

Logger dynamicgraph::Entity::logger_
protected

Definition at line 177 of file include/dynamic-graph/entity.h.

◆ name

std::string dynamicgraph::Entity::name
protected

Definition at line 174 of file include/dynamic-graph/entity.h.

◆ signalMap

SignalMap dynamicgraph::Entity::signalMap
protected

Definition at line 175 of file include/dynamic-graph/entity.h.


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


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:06:03