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
Stack Of Tasks
dynamic-graph
Commits
a432add4
Commit
a432add4
authored
1 year ago
by
Florent Lamiraux
Committed by
Florent Lamiraux
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[Command] Implement setter command for uint64_t.
parent
ea428009
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/dynamic-graph/command-setter.t.cpp
+35
-0
35 additions, 0 deletions
include/dynamic-graph/command-setter.t.cpp
with
35 additions
and
0 deletions
include/dynamic-graph/command-setter.t.cpp
+
35
−
0
View file @
a432add4
...
...
@@ -86,6 +86,41 @@ Value Setter<E, unsigned>::doExecute() {
return
Value
();
}
//
// Template specialization: unsigned long
//
template
<
class
E
>
class
Setter
<
E
,
unsigned
long
>
:
public
Command
{
public:
/// Pointer to method that sets parameter of type unsigned long
typedef
void
(
E
::*
SetterMethod
)(
const
unsigned
long
&
);
/// Constructor
Setter
(
E
&
entity
,
SetterMethod
setterMethod
,
const
std
::
string
&
docString
);
protected:
virtual
Value
doExecute
();
private:
SetterMethod
setterMethod_
;
};
// Class Setter
template
<
class
E
>
Setter
<
E
,
unsigned
long
>::
Setter
(
E
&
entity
,
SetterMethod
setterMethod
,
const
std
::
string
&
docString
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
UNSIGNEDLONGINT
),
docString
),
setterMethod_
(
setterMethod
)
{}
template
<
class
E
>
Value
Setter
<
E
,
unsigned
long
>::
doExecute
()
{
const
std
::
vector
<
Value
>
&
values
=
getParameterValues
();
// Get parameter
unsigned
long
value
=
values
[
0
].
value
();
E
&
entity
=
static_cast
<
E
&>
(
owner
());
(
entity
.
*
setterMethod_
)(
value
);
return
Value
();
}
//
// Template specialization: int
//
...
...
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