Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
dynamic-graph
Commits
34801f48
Commit
34801f48
authored
13 years ago
by
Thomas Moulard
Browse files
Options
Downloads
Patches
Plain Diff
Add helper macro for entity declaration. Use it when possible.
parent
9de21fbb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/dynamic-graph/entity.h
+26
-7
26 additions, 7 deletions
include/dynamic-graph/entity.h
include/dynamic-graph/tracer-real-time.h
+1
-6
1 addition, 6 deletions
include/dynamic-graph/tracer-real-time.h
include/dynamic-graph/tracer.h
+1
-9
1 addition, 9 deletions
include/dynamic-graph/tracer.h
with
28 additions
and
22 deletions
include/dynamic-graph/entity.h
+
26
−
7
View file @
34801f48
...
...
@@ -30,6 +30,31 @@
# include <dynamic-graph/signal-array.h>
# include <dynamic-graph/signal-base.h>
/// \brief Helper macro for entity declaration.
///
/// This macro should be called in the declaration of all entities.
/// Example:
/// <code>
/// class A : public dynamicgraph::entity
/// {
/// DYNAMIC_GRAPH_ENTITY_DECL();
///
/// public:
// // your class here
/// };
/// </code>
///
/// Caution: you *MUST* call DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN in the
/// associated source file to ensure that the attributes generated by
/// this macro are correctly initialized.
# define DYNAMIC_GRAPH_ENTITY_DECL() \
public: \
virtual const std::string& getClassName () const \
{ \
return CLASS_NAME; \
} \
static const std::string CLASS_NAME
namespace
dynamicgraph
{
/// \ingroup dgraph
...
...
@@ -46,12 +71,11 @@ namespace dynamicgraph
/// customize the command-line by overriding commandLine ().
class
DYNAMIC_GRAPH_DLLAPI
Entity
:
private
boost
::
noncopyable
{
DYNAMIC_GRAPH_ENTITY_DECL
();
public:
typedef
std
::
map
<
std
::
string
,
SignalBase
<
int
>*
>
SignalMap
;
typedef
std
::
map
<
const
std
::
string
,
command
::
Command
*>
CommandMap_t
;
static
const
std
::
string
CLASS_NAME
;
explicit
Entity
(
const
std
::
string
&
name
);
virtual
~
Entity
();
...
...
@@ -60,11 +84,6 @@ namespace dynamicgraph
return
name
;
}
virtual
const
std
::
string
&
getClassName
()
const
{
return
CLASS_NAME
;
}
SignalBase
<
int
>&
getSignal
(
const
std
::
string
&
signalName
);
const
SignalBase
<
int
>&
getSignal
(
const
std
::
string
&
signalName
)
const
;
std
::
ostream
&
displaySignalList
(
std
::
ostream
&
os
)
const
;
...
...
This diff is collapsed.
Click to expand it.
include/dynamic-graph/tracer-real-time.h
+
1
−
6
View file @
34801f48
...
...
@@ -52,13 +52,8 @@ namespace dynamicgraph
/// \brief Main class of the tracer real-time plug-in.
class
DG_TRACERREALTIME_DLLAPI
TracerRealTime
:
public
Tracer
{
DYNAMIC_GRAPH_ENTITY_DECL
();
public:
static
const
std
::
string
CLASS_NAME
;
virtual
const
std
::
string
&
getClassName
()
const
{
return
CLASS_NAME
;
}
TracerRealTime
(
const
std
::
string
n
);
virtual
~
TracerRealTime
()
{}
...
...
This diff is collapsed.
Click to expand it.
include/dynamic-graph/tracer.h
+
1
−
9
View file @
34801f48
...
...
@@ -36,18 +36,10 @@ namespace dynamicgraph
/// \brief Tracer plug-in main class.
class
DG_TRACER_DLLAPI
Tracer
:
public
Entity
{
DYNAMIC_GRAPH_ENTITY_DECL
();
protected:
typedef
std
::
list
<
const
SignalBase
<
int
>*
>
SignalList
;
SignalList
toTraceSignals
;
public:
static
const
std
::
string
CLASS_NAME
;
virtual
const
std
::
string
&
getClassName
()
const
{
return
CLASS_NAME
;
}
public:
enum
TraceStyle
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment