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< sigtime_t > * > 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< sigtime_t > & getSignal (const std::string &signalName)
 Provides a reference to the signal named signalName. More...
 
const SignalBase< sigtime_t > & 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< sigtime_t > * test ()
 
virtual void test2 (SignalBase< sigtime_t > *)
 
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 ()
 
const Loggerlogger () 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< sigtime_t > &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<sigtime_t> *> 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 191 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 170 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 135 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 186 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 206 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 202 of file src/dgraph/entity.cpp.

◆ getSignal() [1/2]

SignalBase<sigtime_t>& 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<sigtime_t>& 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 179 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 109 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]

const Logger& 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 215 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< sigtime_t > &  signals)
protected

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

◆ test()

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

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

◆ test2()

virtual void dynamicgraph::Entity::test2 ( SignalBase< sigtime_t > *  )
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 159 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 150 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 Fri Aug 2 2024 08:36:39