From 2283aed5363b3c3a8e93f573f9e9a2211b56669c Mon Sep 17 00:00:00 2001 From: Florent Lamiraux Date: Thu, 15 Jun 2023 16:07:40 +0200 Subject: [PATCH 1/8] Define a specific type for signal time. --- include/dynamic-graph/entity.h | 12 ++++---- include/dynamic-graph/fwd.hh | 2 ++ include/dynamic-graph/pool.h | 2 +- include/dynamic-graph/signal-array.h | 2 +- include/dynamic-graph/signal-helper.h | 18 ++++++------ include/dynamic-graph/tracer-real-time.h | 4 +-- include/dynamic-graph/tracer.h | 14 ++++----- src/dgraph/entity.cpp | 36 +++++++++++++----------- src/dgraph/pool.cpp | 21 +------------- src/signal/signal-array.cpp | 2 +- src/traces/tracer-real-time.cpp | 4 +-- src/traces/tracer.cpp | 18 ++++++------ tests/debug-real-time-tracer.cpp | 18 ++++++------ tests/debug-tracer.cpp | 26 +++++++++-------- tests/entity.cpp | 11 ++++---- tests/pool.cpp | 9 +++--- 16 files changed, 95 insertions(+), 104 deletions(-) diff --git a/include/dynamic-graph/entity.h b/include/dynamic-graph/entity.h index acb2b86d..2f75bf9b 100644 --- a/include/dynamic-graph/entity.h +++ b/include/dynamic-graph/entity.h @@ -51,7 +51,7 @@ namespace dynamicgraph { /// DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN macro in factory.h. class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { public: - typedef std::map *> SignalMap; + typedef std::map *> SignalMap; typedef std::map CommandMap_t; explicit Entity(const std::string &name); @@ -76,13 +76,13 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { \param signalName: Name of the signal \return A reference to the signal with a temporal dependency. */ - SignalBase &getSignal(const std::string &signalName); + SignalBase &getSignal(const std::string &signalName); /** \brief Provides a const reference to the signal named signalName. \param signalName: Name of the signal \return A const reference to the signal with a temporal dependency. */ - const SignalBase &getSignal(const std::string &signalName) const; + const SignalBase &getSignal(const std::string &signalName) const; /** \brief Display the list of signals of this entity in output stream os. \param os: the output stream where to display the list of signals. @@ -108,9 +108,9 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { */ virtual void display(std::ostream &os) const; - virtual SignalBase *test() { return 0; } + virtual SignalBase *test() { return 0; } - virtual void test2(SignalBase *) { return; } + virtual void test2(SignalBase *) { return; } const std::string &getCommandList() const; @@ -168,7 +168,7 @@ class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { void entityRegistration(); void entityDeregistration(); - void signalRegistration(const SignalArray &signals); + void signalRegistration(const SignalArray &signals); void signalDeregistration(const std::string &name); std::string name; diff --git a/include/dynamic-graph/fwd.hh b/include/dynamic-graph/fwd.hh index 54cb3f30..e7541020 100644 --- a/include/dynamic-graph/fwd.hh +++ b/include/dynamic-graph/fwd.hh @@ -8,6 +8,8 @@ #include namespace dynamicgraph { +// Set a typedef for signal time type +typedef int sigtime_t; // to be replace by std:: when we switch to C++11 and later using boost::const_pointer_cast; diff --git a/include/dynamic-graph/pool.h b/include/dynamic-graph/pool.h index b9cbd2e8..d7c647f0 100644 --- a/include/dynamic-graph/pool.h +++ b/include/dynamic-graph/pool.h @@ -91,7 +91,7 @@ class DYNAMIC_GRAPH_DLLAPI PoolStorage { /// \brief Get a signal by name /// /// \param sigpath stream containing a string of the form "entity.signal" - SignalBase &getSignal(std::istringstream &sigpath); + SignalBase &getSignal(std::istringstream &sigpath); /*! \brief This method write a graph description on the file named FileName. */ diff --git a/include/dynamic-graph/signal-array.h b/include/dynamic-graph/signal-array.h index 151c5053..15db4b75 100644 --- a/include/dynamic-graph/signal-array.h +++ b/include/dynamic-graph/signal-array.h @@ -147,7 +147,7 @@ SignalArray