Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CL Configurator
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
BIAS
Configurators
CL Configurator
Compare revisions
040a6736589b17033f28c9ad2f71879c1fcc7453 to 4ab1353f28eccfa75f7216306ed9c893bced1083
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
bias/configurators/cl-configurator
Select target project
No results found
4ab1353f28eccfa75f7216306ed9c893bced1083
Select Git revision
Branches
main
Tags
v1.0
Swap
Target
bias/configurators/cl-configurator
Select target project
bias/configurators/cl-configurator
1 result
040a6736589b17033f28c9ad2f71879c1fcc7453
Select Git revision
Branches
main
Tags
v1.0
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
adding doxygen
· d9a305dc
Valerio Pastore
authored
1 year ago
d9a305dc
.
· 588230ea
Valerio Pastore
authored
1 year ago
588230ea
.
· 4ab1353f
Valerio Pastore
authored
1 year ago
4ab1353f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
deps/Base-DAQ
+1
-1
1 addition, 1 deletion
deps/Base-DAQ
include/CL_Conf.h
+20
-5
20 additions, 5 deletions
include/CL_Conf.h
src/CL_Conf.cpp
+7
-6
7 additions, 6 deletions
src/CL_Conf.cpp
with
28 additions
and
12 deletions
Base-DAQ
@
a00f9a27
Compare
8a0ea2d0
...
a00f9a27
Subproject commit
8
a0
ea2d0e699863df5fe1c91caf2d7b0855957be
Subproject commit a0
0f9a27afbf5f75dab7db2368b9b9b6fcb395e1
This diff is collapsed.
Click to expand it.
include/CL_Conf.h
View file @
4ab1353f
...
...
@@ -4,21 +4,36 @@
namespace
inaf
::
oasbo
::
Configurators
{
/**
* @brief The CLConfigurator class is a concrete implementation of the BaseConfigurator class.
* It provides functionality to read and push configurations from/to a source using command line arguments (--param1 --param2 and so on).
* Check the Base_Configurator.h file for more information.
*/
class
CLConfigurator
:
public
BaseConfigurator
{
protected:
int
argc
;
char
**
argv
;
int
argc
;
/**< The number of command line arguments. */
char
**
argv
;
/**< The array of command line arguments. */
public:
CLConfigurator
(
int
argc
,
char
**
argv
);
/**
* @brief Constructs a CLConfigurator object with the specified command line arguments.
* @param argc The number of command line arguments.
* @param argv The array of command line arguments.
*/
CLConfigurator
(
int
argc
,
char
**
argv
);
int
readConfigFromSource
()
override
;
int
readConfigFromSource
(
std
::
string
target
)
override
;
int
pushConfigToSource
()
override
;
int
pushConfigToSource
(
std
::
string
target
)
override
;
int
insert
(
std
::
map
<
std
::
string
,
std
::
string
>
,
std
::
string
target
)
override
;
~
CLConfigurator
()
{
}
~
CLConfigurator
()
{
}
};
}
This diff is collapsed.
Click to expand it.
src/CL_Conf.cpp
View file @
4ab1353f
...
...
@@ -17,27 +17,28 @@ int CLConfigurator::pushConfigToSource() {
}
int
CLConfigurator
::
readConfigFromSource
(
std
::
string
target
)
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
std
::
string
arg
=
argv
[
i
];
boost
::
to_lower
(
arg
);
size_t
posTarget
=
arg
.
find
(
"--"
+
target
);
size_t
posTarget
=
arg
.
find
(
"--"
+
target
);
size_t
posSeparator
=
arg
.
find
(
'_'
);
if
(
posTarget
==
0
&&
posSeparator
==
std
::
string
(
"--"
+
target
).
size
())
{
if
(
posTarget
==
0
&&
posSeparator
==
std
::
string
(
"--"
+
target
).
size
())
{
std
::
string
key
=
arg
.
substr
(
2
);
this
->
config
[
key
]
=
argv
[
i
+
1
];
this
->
config
[
key
]
=
argv
[
i
+
1
];
}
}
return
1
;
}
int
CLConfigurator
::
readConfigFromSource
()
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
-
1
;
++
i
)
{
std
::
string
arg
=
argv
[
i
];
size_t
posDash
=
arg
.
find
(
"--"
);
size_t
posSeparator
=
arg
.
find
(
'_'
);
if
(
posDash
==
0
&&
posSeparator
!=
std
::
string
::
npos
)
{
std
::
string
key
=
arg
.
substr
(
2
);
this
->
config
[
key
]
=
argv
[
i
+
1
];
this
->
config
[
key
]
=
argv
[
i
+
1
];
}
}
return
1
;
...
...
This diff is collapsed.
Click to expand it.