Go to the documentation of this file.
7 #ifndef DYNAMIC_GRAPH_SIGNAL_BASE_H
8 #define DYNAMIC_GRAPH_SIGNAL_BASE_H
11 #include <boost/noncopyable.hpp>
27 class SignalBase :
public boost::noncopyable {
45 aClassName =
typeid(
this).
name();
67 virtual std::ostream &
writeGraph(std::ostream &os)
const {
return os; }
70 std::string space =
"",
71 std::string next1 =
"",
72 std::string =
"")
const {
73 os << space << next1 <<
"-- ";
90 "Plug-in operation not possible with this signal. ",
91 "(while trying to plug %s on %s).", sigarg->getName().c_str(),
92 this->getName().c_str());
98 "Plug-in operation not possible with this signal. ",
99 "(while trying to unplug %s).", this->
getName().c_str());
109 "Plug-in operation not possible with this signal. ",
110 "(while trying to save %s).", this->
getName().c_str());
121 virtual void set(std::istringstream &) {
123 "Set operation not possible with this signal. ",
124 "(while trying to set %s).",
128 virtual void get(std::ostream &)
const {
130 "Get operation not possible with this signal. ",
131 "(while trying to get %s).",
138 "Recompute operation not possible with this signal. ",
139 "(while trying to recompute %s).", this->
getName().c_str());
142 virtual void trace(std::ostream &)
const {
144 "Trace operation not possible with this signal. ",
145 "(while trying to trace %s).",
154 virtual std::ostream &
display(std::ostream &os)
const {
155 os <<
"Sig:" <<
name;
160 std::istringstream iss(
name);
161 const int SIZE = 128;
164 iss.getline(buffer, SIZE,
':');
166 const std::string res(buffer);
175 std::string &NodeName)
const {
176 std::string fullname = this->
getName();
178 size_t IdxPosLocalName = fullname.rfind(
":");
179 LocalName = fullname.substr(IdxPosLocalName + 1,
180 fullname.length() - IdxPosLocalName + 1);
181 size_t IdxPosNodeNameStart = fullname.find(
"(");
182 size_t IdxPosNodeNameEnd = fullname.find(
")");
183 NodeName = fullname.substr(IdxPosNodeNameStart + 1,
184 IdxPosNodeNameEnd - IdxPosNodeNameStart - 1);
196 template <
class Time>
198 return sig.display(os);
virtual const Time & getTime() const
virtual void setTime(const Time &t)
DYNAMIC_GRAPH_DLLAPI std::ostream & operator<<(std::ostream &os, const dynamicgraph::Entity &ent)
virtual void ExtractNodeAndLocalNames(std::string &LocalName, std::string &NodeName) const
virtual std::ostream & displayDependencies(std::ostream &os, const int=-1, std::string space="", std::string next1="", std::string="") const
virtual void recompute(const Time &)
void getClassName(std::string &aClassName) const
virtual void setPeriodTime(const Time &)
virtual void setConstantDefault()
SignalBase(std::string name="")
virtual std::ostream & display(std::ostream &os) const
virtual void get(std::ostream &) const
virtual void set(std::istringstream &)
virtual bool isPlugged() const
virtual SignalBase< Time > * getPluged() const
dynamicgraph::SignalArray_const< double > sig
virtual void plug(SignalBase< Time > *sigarg)
const std::string & getName() const
std::string shortName() const
virtual void addDependency(const SignalBase< Time > &)
Exceptions raised when an error related to signals happen.
virtual void removeDependency(const SignalBase< Time > &)
virtual bool needUpdate(const Time &) const
virtual std::ostream & writeGraph(std::ostream &os) const
virtual void trace(std::ostream &) const
The base class for signals: not to be used as such.
virtual void clearDependencies()
const bool & getReady() const
virtual Time getPeriodTime() const
void setReady(const bool sready=true)
dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38