Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph
Commits
681d5b45
Unverified
Commit
681d5b45
authored
Aug 18, 2021
by
Guilhem Saurel
Committed by
GitHub
Aug 18, 2021
Browse files
Merge pull request #88 from nim65s/devel
add doc/make CommandVoid 5-8
parents
ec98d1ca
6a0aa99a
Pipeline
#15652
passed with stage
in 2 minutes and 33 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/dynamic-graph/command-bind.h
View file @
681d5b45
...
...
@@ -343,6 +343,338 @@ inline std::string docCommandVoid4(const std::string &doc,
}
// namespace command
}
// namespace dynamicgraph
/* --- FUNCTION 5 ARGS ------------------------------------------------------ */
namespace
dynamicgraph
{
namespace
command
{
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
>
struct
CommandVoid5
:
public
Command
{
typedef
boost
::
function
<
void
(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
)
>
function_t
;
typedef
void
(
E
::*
memberFunction_ptr_t
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
);
CommandVoid5
(
E
&
entity
,
function_t
function
,
const
std
::
string
&
docString
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
ValueHelper
<
T1
>::
TypeID
)(
ValueHelper
<
T2
>::
TypeID
)(
ValueHelper
<
T3
>::
TypeID
)(
ValueHelper
<
T4
>::
TypeID
)(
ValueHelper
<
T5
>::
TypeID
),
docString
),
fptr
(
function
)
{}
protected:
virtual
Value
doExecute
()
{
assert
(
getParameterValues
().
size
()
==
5
);
T1
val1
=
getParameterValues
()[
0
].
value
();
T2
val2
=
getParameterValues
()[
1
].
value
();
T3
val3
=
getParameterValues
()[
2
].
value
();
T4
val4
=
getParameterValues
()[
3
].
value
();
T5
val5
=
getParameterValues
()[
4
].
value
();
fptr
(
val1
,
val2
,
val3
,
val4
,
val5
);
return
Value
();
// void
}
private:
function_t
fptr
;
};
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
>
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>
*
makeCommandVoid5
(
E
&
entity
,
typename
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>::
function_t
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>
(
entity
,
function
,
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
>
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>
*
makeCommandVoid5
(
E
&
entity
,
boost
::
function
<
void
(
E
*
,
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
)
>
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
),
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
>
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>
*
makeCommandVoid5
(
E
&
entity
,
void
(
E
::*
function
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
),
const
std
::
string
&
docString
)
{
return
new
CommandVoid5
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
),
docString
);
return
NULL
;
}
inline
std
::
string
docCommandVoid5
(
const
std
::
string
&
doc
,
const
std
::
string
&
type1
,
const
std
::
string
&
type2
,
const
std
::
string
&
type3
,
const
std
::
string
&
type4
,
const
std
::
string
&
type5
)
{
return
(
std
::
string
(
"
\n
"
)
+
doc
+
"
\n\n
"
+
"Input:
\n
- A "
+
type1
+
".
\n
"
+
"Input:
\n
- A "
+
type2
+
".
\n
"
+
"Input:
\n
- A "
+
type3
+
".
\n
"
+
"Input:
\n
- A "
+
type4
+
".
\n
"
+
"Input:
\n
- A "
+
type5
+
".
\n
"
+
"Void return.
\n\n
"
);
}
}
// namespace command
}
// namespace dynamicgraph
/* --- FUNCTION 6 ARGS ------------------------------------------------------ */
namespace
dynamicgraph
{
namespace
command
{
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
>
struct
CommandVoid6
:
public
Command
{
typedef
boost
::
function
<
void
(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
)
>
function_t
;
typedef
void
(
E
::*
memberFunction_ptr_t
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
);
CommandVoid6
(
E
&
entity
,
function_t
function
,
const
std
::
string
&
docString
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
ValueHelper
<
T1
>::
TypeID
)(
ValueHelper
<
T2
>::
TypeID
)(
ValueHelper
<
T3
>::
TypeID
)(
ValueHelper
<
T4
>::
TypeID
)(
ValueHelper
<
T5
>::
TypeID
)(
ValueHelper
<
T6
>::
TypeID
),
docString
),
fptr
(
function
)
{}
protected:
virtual
Value
doExecute
()
{
assert
(
getParameterValues
().
size
()
==
6
);
T1
val1
=
getParameterValues
()[
0
].
value
();
T2
val2
=
getParameterValues
()[
1
].
value
();
T3
val3
=
getParameterValues
()[
2
].
value
();
T4
val4
=
getParameterValues
()[
3
].
value
();
T5
val5
=
getParameterValues
()[
4
].
value
();
T6
val6
=
getParameterValues
()[
5
].
value
();
fptr
(
val1
,
val2
,
val3
,
val4
,
val5
,
val6
);
return
Value
();
// void
}
private:
function_t
fptr
;
};
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
>
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
*
makeCommandVoid6
(
E
&
entity
,
typename
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>::
function_t
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
(
entity
,
function
,
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
>
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
*
makeCommandVoid6
(
E
&
entity
,
boost
::
function
<
void
(
E
*
,
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
)
>
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
,
_6
),
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
>
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
*
makeCommandVoid6
(
E
&
entity
,
void
(
E
::*
function
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
),
const
std
::
string
&
docString
)
{
return
new
CommandVoid6
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
,
_6
),
docString
);
return
NULL
;
}
inline
std
::
string
docCommandVoid6
(
const
std
::
string
&
doc
,
const
std
::
string
&
type1
,
const
std
::
string
&
type2
,
const
std
::
string
&
type3
,
const
std
::
string
&
type4
,
const
std
::
string
&
type5
,
const
std
::
string
&
type6
)
{
return
(
std
::
string
(
"
\n
"
)
+
doc
+
"
\n\n
"
+
"Input:
\n
- A "
+
type1
+
".
\n
"
+
"Input:
\n
- A "
+
type2
+
".
\n
"
+
"Input:
\n
- A "
+
type3
+
".
\n
"
+
"Input:
\n
- A "
+
type4
+
".
\n
"
+
"Input:
\n
- A "
+
type5
+
".
\n
"
+
"Input:
\n
- A "
+
type6
+
".
\n
"
+
"Void return.
\n\n
"
);
}
}
// namespace command
}
// namespace dynamicgraph
/* --- FUNCTION 7 ARGS ------------------------------------------------------ */
namespace
dynamicgraph
{
namespace
command
{
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
>
struct
CommandVoid7
:
public
Command
{
typedef
boost
::
function
<
void
(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
)
>
function_t
;
typedef
void
(
E
::*
memberFunction_ptr_t
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
);
CommandVoid7
(
E
&
entity
,
function_t
function
,
const
std
::
string
&
docString
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
ValueHelper
<
T1
>::
TypeID
)(
ValueHelper
<
T2
>::
TypeID
)(
ValueHelper
<
T3
>::
TypeID
)(
ValueHelper
<
T4
>::
TypeID
)(
ValueHelper
<
T5
>::
TypeID
)(
ValueHelper
<
T6
>::
TypeID
)(
ValueHelper
<
T7
>::
TypeID
),
docString
),
fptr
(
function
)
{}
protected:
virtual
Value
doExecute
()
{
assert
(
getParameterValues
().
size
()
==
7
);
T1
val1
=
getParameterValues
()[
0
].
value
();
T2
val2
=
getParameterValues
()[
1
].
value
();
T3
val3
=
getParameterValues
()[
2
].
value
();
T4
val4
=
getParameterValues
()[
3
].
value
();
T5
val5
=
getParameterValues
()[
4
].
value
();
T6
val6
=
getParameterValues
()[
5
].
value
();
T7
val7
=
getParameterValues
()[
6
].
value
();
fptr
(
val1
,
val2
,
val3
,
val4
,
val5
,
val6
,
val7
);
return
Value
();
// void
}
private:
function_t
fptr
;
};
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
>
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>
*
makeCommandVoid7
(
E
&
entity
,
typename
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>::
function_t
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>
(
entity
,
function
,
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
>
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>
*
makeCommandVoid7
(
E
&
entity
,
boost
::
function
<
void
(
E
*
,
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
)
>
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
,
_6
,
_7
),
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
>
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>
*
makeCommandVoid7
(
E
&
entity
,
void
(
E
::*
function
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
),
const
std
::
string
&
docString
)
{
return
new
CommandVoid7
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
,
_6
,
_7
),
docString
);
return
NULL
;
}
inline
std
::
string
docCommandVoid7
(
const
std
::
string
&
doc
,
const
std
::
string
&
type1
,
const
std
::
string
&
type2
,
const
std
::
string
&
type3
,
const
std
::
string
&
type4
,
const
std
::
string
&
type5
,
const
std
::
string
&
type6
,
const
std
::
string
&
type7
)
{
return
(
std
::
string
(
"
\n
"
)
+
doc
+
"
\n\n
"
+
"Input:
\n
- A "
+
type1
+
".
\n
"
+
"Input:
\n
- A "
+
type2
+
".
\n
"
+
"Input:
\n
- A "
+
type3
+
".
\n
"
+
"Input:
\n
- A "
+
type4
+
".
\n
"
+
"Input:
\n
- A "
+
type5
+
".
\n
"
+
"Input:
\n
- A "
+
type6
+
".
\n
"
+
"Input:
\n
- A "
+
type7
+
".
\n
"
+
"Void return.
\n\n
"
);
}
}
// namespace command
}
// namespace dynamicgraph
/* --- FUNCTION 8 ARGS ------------------------------------------------------ */
namespace
dynamicgraph
{
namespace
command
{
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
>
struct
CommandVoid8
:
public
Command
{
typedef
boost
::
function
<
void
(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
,
const
T8
&
)
>
function_t
;
typedef
void
(
E
::*
memberFunction_ptr_t
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
,
const
T8
&
);
CommandVoid8
(
E
&
entity
,
function_t
function
,
const
std
::
string
&
docString
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
ValueHelper
<
T1
>::
TypeID
)(
ValueHelper
<
T2
>::
TypeID
)(
ValueHelper
<
T3
>::
TypeID
)(
ValueHelper
<
T4
>::
TypeID
)(
ValueHelper
<
T5
>::
TypeID
)(
ValueHelper
<
T6
>::
TypeID
)(
ValueHelper
<
T7
>::
TypeID
)(
ValueHelper
<
T8
>::
TypeID
),
docString
),
fptr
(
function
)
{}
protected:
virtual
Value
doExecute
()
{
assert
(
getParameterValues
().
size
()
==
8
);
T1
val1
=
getParameterValues
()[
0
].
value
();
T2
val2
=
getParameterValues
()[
1
].
value
();
T3
val3
=
getParameterValues
()[
2
].
value
();
T4
val4
=
getParameterValues
()[
3
].
value
();
T5
val5
=
getParameterValues
()[
4
].
value
();
T6
val6
=
getParameterValues
()[
5
].
value
();
T7
val7
=
getParameterValues
()[
6
].
value
();
T8
val8
=
getParameterValues
()[
7
].
value
();
fptr
(
val1
,
val2
,
val3
,
val4
,
val5
,
val6
,
val7
,
val8
);
return
Value
();
// void
}
private:
function_t
fptr
;
};
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
>
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>
*
makeCommandVoid8
(
E
&
entity
,
typename
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>::
function_t
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>
(
entity
,
function
,
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
>
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>
*
makeCommandVoid8
(
E
&
entity
,
boost
::
function
<
void
(
E
*
,
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
,
const
T8
&
)
>
function
,
const
std
::
string
&
docString
)
{
return
new
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
,
_6
,
_7
,
_8
),
docString
);
}
template
<
class
E
,
typename
T1
,
typename
T2
,
typename
T3
,
typename
T4
,
typename
T5
,
typename
T6
,
typename
T7
,
typename
T8
>
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>
*
makeCommandVoid8
(
E
&
entity
,
void
(
E
::*
function
)(
const
T1
&
,
const
T2
&
,
const
T3
&
,
const
T4
&
,
const
T5
&
,
const
T6
&
,
const
T7
&
,
const
T8
&
),
const
std
::
string
&
docString
)
{
return
new
CommandVoid8
<
E
,
T1
,
T2
,
T3
,
T4
,
T5
,
T6
,
T7
,
T8
>
(
entity
,
boost
::
bind
(
function
,
&
entity
,
_1
,
_2
,
_3
,
_4
,
_5
,
_6
,
_7
,
_8
),
docString
);
return
NULL
;
}
inline
std
::
string
docCommandVoid8
(
const
std
::
string
&
doc
,
const
std
::
string
&
type1
,
const
std
::
string
&
type2
,
const
std
::
string
&
type3
,
const
std
::
string
&
type4
,
const
std
::
string
&
type5
,
const
std
::
string
&
type6
,
const
std
::
string
&
type7
,
const
std
::
string
&
type8
)
{
return
(
std
::
string
(
"
\n
"
)
+
doc
+
"
\n\n
"
+
"Input:
\n
- A "
+
type1
+
".
\n
"
+
"Input:
\n
- A "
+
type2
+
".
\n
"
+
"Input:
\n
- A "
+
type3
+
".
\n
"
+
"Input:
\n
- A "
+
type4
+
".
\n
"
+
"Input:
\n
- A "
+
type5
+
".
\n
"
+
"Input:
\n
- A "
+
type6
+
".
\n
"
+
"Input:
\n
- A "
+
type7
+
".
\n
"
+
"Input:
\n
- A "
+
type8
+
".
\n
"
+
"Void return.
\n\n
"
);
}
}
// namespace command
}
// namespace dynamicgraph
/* --- FUNCTION VERBOSE ----------------------------------------------------- */
/* This bind a function void f( ostream& ) that display some results into
* a string f( void ) that return some string results. */
...
...
src/CMakeLists.txt
View file @
681d5b45
...
...
@@ -9,7 +9,7 @@ SET(tracer-real-time_deps tracer)
FOREACH
(
plugin
${
plugins
}
)
GET_FILENAME_COMPONENT
(
LIBRARY_NAME
${
plugin
}
NAME
)
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED
${
plugin
}
)
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED
"
${
plugin
}
.cpp"
)
IF
(
SUFFIX_SO_VERSION
)
SET_TARGET_PROPERTIES
(
${
LIBRARY_NAME
}
PROPERTIES SOVERSION
${
PROJECT_VERSION
}
)
...
...
tests/CMakeLists.txt
View file @
681d5b45
...
...
@@ -7,7 +7,7 @@ ADD_DEFINITIONS(-DTESTS_PLUGINDIR="${LIBRARY_OUTPUT_PATH}")
ADD_DEFINITIONS
(
-DTESTS_DYNLIBSUFFIX=
"
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
MACRO
(
DYNAMIC_GRAPH_TEST NAME
)
ADD_UNIT_TEST
(
${
NAME
}
${
NAME
}
.cpp
)
ADD_UNIT_TEST
(
${
NAME
}
"
${
NAME
}
.cpp
"
)
TARGET_LINK_LIBRARIES
(
${
NAME
}
PRIVATE
${
PROJECT_NAME
}
Boost::unit_test_framework
)
ENDMACRO
(
DYNAMIC_GRAPH_TEST
)
...
...
@@ -15,7 +15,7 @@ ENDMACRO(DYNAMIC_GRAPH_TEST)
SET
(
signalcast_libs signal-cast-registerer-libA signal-cast-registerer-libB
)
FOREACH
(
lib
${
signalcast_libs
}
)
ADD_LIBRARY
(
${
lib
}
SHARED
${
lib
}
)
ADD_LIBRARY
(
${
lib
}
SHARED
"
${
lib
}
.cpp"
)
TARGET_LINK_LIBRARIES
(
${
lib
}
PRIVATE
${
PROJECT_NAME
}
)
ENDFOREACH
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment