6 #ifndef DYNAMIC_GRAPH_ENTITY_H 7 #define DYNAMIC_GRAPH_ENTITY_H 13 #include <boost/noncopyable.hpp> 15 #include <dynamic-graph/dynamic-graph-api.h> 16 #include <dynamic-graph/exception-factory.h> 17 #include <dynamic-graph/fwd.hh> 18 #include <dynamic-graph/logger.h> 19 #include <dynamic-graph/signal-array.h> 20 #include <dynamic-graph/signal-base.h> 39 #define DYNAMIC_GRAPH_ENTITY_DECL() \ 41 virtual const std::string &getClassName() const { return CLASS_NAME; } \ 42 static const std::string CLASS_NAME 53 class DYNAMIC_GRAPH_DLLAPI
Entity :
private boost::noncopyable {
55 typedef std::map<std::string, SignalBase<int> *> SignalMap;
56 typedef std::map<const std::string, command::Command *> CommandMap_t;
58 explicit Entity(
const std::string &name);
61 const std::string &getName()
const {
return name; }
62 virtual const std::string &getClassName()
const {
63 static std::string ret(
"Entity");
69 virtual std::string getDocString()
const;
74 bool hasSignal(
const std::string &signame)
const;
92 std::ostream &displaySignalList(std::ostream &os)
const;
99 virtual std::ostream &writeGraph(std::ostream &os)
const;
106 virtual std::ostream &writeCompletionList(std::ostream &os)
const;
110 virtual void display(std::ostream &os)
const;
116 const std::string &getCommandList()
const;
121 CommandMap_t getNewStyleCommandMap();
131 SignalMap getSignalMap()
const;
136 Logger &logger() {
return logger_; };
137 Logger const &logger()
const {
return logger_; };
141 void sendMsg(
const std::string &msg,
MsgType t = MSG_TYPE_INFO,
142 const std::string &lineId =
"");
158 return logger_.setStreamPrintPeriod(t);
169 void entityRegistration();
170 void entityDeregistration();
173 void signalDeregistration(
const std::string &name);
177 CommandMap_t commandMap;
181 DYNAMIC_GRAPH_DLLAPI std::ostream &operator<<(std::ostream &os,
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
LoggerVerbosity getLoggerVerbosityLevel()
Get the logger's verbosity level.
bool setStreamPrintPeriod(double t)
Set the period of the stream period.
double getStreamPrintPeriod()
Get the period of the stream period.
bool setTimeSample(double t)
Set the time sample.
void setLoggerVerbosityLevel(LoggerVerbosity lv)
Specify the verbosity level of the logger.
Class for logging messages.
double getTimeSample()
Get the time sample.