6 #ifndef DYNAMIC_GRAPH_ENTITY_H
7 #define DYNAMIC_GRAPH_ENTITY_H
8 #include <dynamic-graph/dynamic-graph-api.h>
9 #include <dynamic-graph/exception-factory.h>
10 #include <dynamic-graph/logger.h>
11 #include <dynamic-graph/signal-array.h>
12 #include <dynamic-graph/signal-base.h>
14 #include <boost/noncopyable.hpp>
15 #include <dynamic-graph/fwd.hh>
38 #define DYNAMIC_GRAPH_ENTITY_DECL() \
40 virtual const std::string &getClassName() const { return CLASS_NAME; } \
41 static const std::string CLASS_NAME
52 class DYNAMIC_GRAPH_DLLAPI
Entity :
private boost::noncopyable {
54 typedef std::map<std::string, SignalBase<int> *> SignalMap;
55 typedef std::map<const std::string, command::Command *> CommandMap_t;
57 explicit Entity(
const std::string &name);
60 const std::string &getName()
const {
return name; }
61 virtual const std::string &getClassName()
const {
62 static std::string ret(
"Entity");
68 virtual std::string getDocString()
const;
73 bool hasSignal(
const std::string &signame)
const;
91 std::ostream &displaySignalList(std::ostream &os)
const;
98 virtual std::ostream &writeGraph(std::ostream &os)
const;
105 virtual std::ostream &writeCompletionList(std::ostream &os)
const;
109 virtual void display(std::ostream &os)
const;
115 const std::string &getCommandList()
const;
120 CommandMap_t getNewStyleCommandMap();
130 SignalMap getSignalMap()
const;
135 Logger &logger() {
return logger_; };
136 Logger const &logger()
const {
return logger_; };
140 void sendMsg(
const std::string &msg,
MsgType t = MSG_TYPE_INFO,
141 const std::string &lineId =
"");
157 return logger_.setStreamPrintPeriod(t);
168 void entityRegistration();
169 void entityDeregistration();
172 void signalDeregistration(
const std::string &name);
176 CommandMap_t commandMap;
180 DYNAMIC_GRAPH_DLLAPI std::ostream &operator<<(std::ostream &os,