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
ea428009
Commit
ea428009
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 int64_t.
parent
45354a8b
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
+34
-0
34 additions, 0 deletions
include/dynamic-graph/command-setter.t.cpp
with
34 additions
and
0 deletions
include/dynamic-graph/command-setter.t.cpp
+
34
−
0
View file @
ea428009
...
@@ -120,6 +120,40 @@ Value Setter<E, int>::doExecute() {
...
@@ -120,6 +120,40 @@ Value Setter<E, int>::doExecute() {
return
Value
();
return
Value
();
}
}
//
// Template specialization: int64_t
//
template
<
class
E
>
class
Setter
<
E
,
int64_t
>
:
public
Command
{
public:
/// Pointer to method that sets parameter of type int64_t
typedef
void
(
E
::*
SetterMethod
)(
const
int64_t
&
);
/// Constructor
Setter
(
E
&
entity
,
SetterMethod
setterMethod
,
const
std
::
string
&
docString
);
protected:
virtual
Value
doExecute
();
private:
SetterMethod
setterMethod_
;
};
// Class Setter
template
<
class
E
>
Setter
<
E
,
int64_t
>::
Setter
(
E
&
entity
,
SetterMethod
setterMethod
,
const
std
::
string
&
docString
)
:
Command
(
entity
,
boost
::
assign
::
list_of
(
Value
::
LONGINT
),
docString
),
setterMethod_
(
setterMethod
)
{}
template
<
class
E
>
Value
Setter
<
E
,
int64_t
>::
doExecute
()
{
const
std
::
vector
<
Value
>
&
values
=
getParameterValues
();
// Get parameter
int64_t
value
=
values
[
0
].
value
();
E
&
entity
=
static_cast
<
E
&>
(
owner
());
(
entity
.
*
setterMethod_
)(
value
);
return
Value
();
}
//
//
// Template specialization: float
// Template specialization: float
//
//
...
...
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