Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
ChimeraTK Mirror
ApplicationCore
Commits
c287da7c
Commit
c287da7c
authored
5 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
ConfigReader: add HierarchyModifier argument to constructor (optional)
parent
36933123
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/include/ConfigReader.h
+7
-0
7 additions, 0 deletions
Modules/include/ConfigReader.h
Modules/src/ConfigReader.cc
+17
-2
17 additions, 2 deletions
Modules/src/ConfigReader.cc
with
24 additions
and
2 deletions
Modules/include/ConfigReader.h
+
7
−
0
View file @
c287da7c
...
...
@@ -114,8 +114,12 @@ namespace ChimeraTK {
*/
struct
ConfigReader
:
ApplicationModule
{
ConfigReader
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
fileName
,
HierarchyModifier
hierarchyModifier
=
HierarchyModifier
::
none
,
const
std
::
unordered_set
<
std
::
string
>&
tags
=
{});
ConfigReader
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
fileName
,
const
std
::
unordered_set
<
std
::
string
>&
tags
);
~
ConfigReader
()
override
;
void
mainLoop
()
override
{}
void
prepare
()
override
;
...
...
@@ -128,6 +132,9 @@ namespace ChimeraTK {
const
T
&
get
(
const
std
::
string
&
variableName
)
const
;
protected
:
/** Helper function to avoid code duplication in constructors **/
void
construct
(
const
std
::
string
&
fileName
);
/** File name */
std
::
string
_fileName
;
...
...
This diff is collapsed.
Click to expand it.
Modules/src/ConfigReader.cc
+
17
−
2
View file @
c287da7c
...
...
@@ -240,10 +240,25 @@ namespace ChimeraTK {
/*********************************************************************************************************************/
ConfigReader
::
ConfigReader
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
fileName
,
HierarchyModifier
hierarchyModifier
,
const
std
::
unordered_set
<
std
::
string
>&
tags
)
:
ApplicationModule
(
owner
,
name
,
"Configuration read from file '"
+
fileName
+
"'"
,
hierarchyModifier
,
tags
),
_fileName
(
fileName
),
_moduleList
(
std
::
make_unique
<
ModuleList
>
(
this
))
{
construct
(
fileName
);
}
/*********************************************************************************************************************/
ConfigReader
::
ConfigReader
(
EntityOwner
*
owner
,
const
std
::
string
&
name
,
const
std
::
string
&
fileName
,
const
std
::
unordered_set
<
std
::
string
>&
tags
)
:
ApplicationModule
(
owner
,
name
,
"Configuration read from file '"
+
fileName
+
"'"
,
false
,
tags
),
_fileName
(
fileName
),
_moduleList
(
std
::
make_unique
<
ModuleList
>
(
this
))
{
:
ApplicationModule
(
owner
,
name
,
"Configuration read from file '"
+
fileName
+
"'"
,
HierarchyModifier
::
none
,
tags
),
_fileName
(
fileName
),
_moduleList
(
std
::
make_unique
<
ModuleList
>
(
this
))
{
construct
(
fileName
);
}
/*********************************************************************************************************************/
void
ConfigReader
::
construct
(
const
std
::
string
&
fileName
)
{
auto
fillVariableMap
=
[
this
](
const
Variable
&
var
)
{
bool
processed
{
false
};
boost
::
fusion
::
for_each
(
variableMap
.
table
,
FunctorFill
(
this
,
var
.
type
,
var
.
name
,
var
.
value
,
processed
));
...
...
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