Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
12105975
Commit
12105975
authored
13 years ago
by
Adam Radziszewski
Browse files
Options
Downloads
Patches
Plain Diff
add has (var_name) to ParsedExpression
parent
958384b8
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
libwccl/ops/parsedexpression.h
+14
-0
14 additions, 0 deletions
libwccl/ops/parsedexpression.h
swig/parsedexpression.i
+9
-1
9 additions, 1 deletion
swig/parsedexpression.i
with
24 additions
and
2 deletions
CMakeLists.txt
+
1
−
1
View file @
12105975
...
...
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.0)
set
(
wccl_ver_major
"0"
)
set
(
wccl_ver_minor
"1"
)
set
(
wccl_ver_patch
"
3
"
)
set
(
wccl_ver_patch
"
4
"
)
set
(
LIBWCCL_VERSION
"
${
wccl_ver_major
}
.
${
wccl_ver_minor
}
.
${
wccl_ver_patch
}
"
)
...
...
This diff is collapsed.
Click to expand it.
libwccl/ops/parsedexpression.h
+
14
−
0
View file @
12105975
...
...
@@ -129,6 +129,14 @@ public:
template
<
class
T
>
void
set
(
const
std
::
string
&
var_name
,
const
T
&
value
);
/**
* Checks if has a variable with given name and type.
* @returns if such variable exists AND is of type T.
* @param var_name Variable name.
*/
template
<
class
T
>
bool
has
(
const
std
::
string
&
var_name
);
/**
* Sets all variables to their default values.
* @note Values of variables are preserved between applications
...
...
@@ -235,6 +243,12 @@ void ParsedExpression::set(const std::string& var_name, const T& value) {
get
<
T
>
(
var_name
)
=
value
;
}
template
<
class
T
>
bool
ParsedExpression
::
has
(
const
std
::
string
&
var_name
)
{
boost
::
shared_ptr
<
T
>
value
=
variables_
->
get
<
T
>
(
var_name
);
return
value
;
}
inline
void
ParsedExpression
::
clean
()
{
...
...
This diff is collapsed.
Click to expand it.
swig/parsedexpression.i
+
9
−
1
View file @
12105975
...
...
@@ -42,8 +42,16 @@ namespace Wccl {
%template(get_strset) get<StrSet>;
%template(get_position) get<Position>;
%template(get_match) get<Match>;
template<class T> bool has(const std::string& var_name);
%template(has_bool) has<Bool>;
%template(has_tset) has<TSet>;
%template(has_strset) has<StrSet>;
%template(has_position) has<Position>;
%template(has_match) has<Match>;
/* --------------------------------------------------------------------- */
/* Those functions are overridden later to handle shared_ptr values,
* anyway they are needed for those overrides to work. */
template<class T> void set(const std::string& var_name, const T& value);
%template(set_bool) set<Bool>;
%template(set_tset) set<TSet>;
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment