Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Gaudi
Gaudi
Commits
a3d944f5
Commit
a3d944f5
authored
7 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
Add Doxygen comments.
parent
ac7f0b6d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h
+4
-1
4 additions, 1 deletion
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h
GaudiKernel/Gaudi/Interfaces/OptionsSvc.h
+27
-0
27 additions, 0 deletions
GaudiKernel/Gaudi/Interfaces/OptionsSvc.h
with
31 additions
and
1 deletion
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h
+
4
−
1
View file @
a3d944f5
...
...
@@ -33,9 +33,12 @@ private:
mutable
std
::
map
<
std
::
string
,
std
::
unique_ptr
<
Gaudi
::
Details
::
PropertyBase
>>
m_old_iface_compat
;
mutable
std
::
map
<
std
::
string
,
PropertiesT
>
m_old_iface_compat_2
;
/// Find an option key in the options storage using case insensitive comparison.
/// If the found key does not match the case of the requested one, a warning is printed.
StorageType
::
const_iterator
find
(
const
std
::
string
&
key
,
bool
warn
)
const
;
protected:
/// @{
void
set
(
const
std
::
string
&
key
,
const
std
::
string
&
value
)
override
{
m_options
[
key
]
=
value
;
}
std
::
string
get
(
const
std
::
string
&
key
,
const
std
::
string
&
default_
=
{}
)
const
override
{
...
...
@@ -61,7 +64,7 @@ protected:
std
::
for_each
(
begin
(
m_options
),
end
(
m_options
),
[
&
v
](
const
auto
&
item
)
{
v
.
emplace_back
(
item
);
}
);
return
v
;
}
/// @}
public
:
// Constructor
JobOptionsSvc
(
const
std
::
string
&
name
,
ISvcLocator
*
svc
);
...
...
This diff is collapsed.
Click to expand it.
GaudiKernel/Gaudi/Interfaces/OptionsSvc.h
+
27
−
0
View file @
a3d944f5
...
...
@@ -8,12 +8,39 @@ namespace Gaudi
{
namespace
Interfaces
{
/** Interface for a component that manages application configuration options.
Options are to be recorded as pairs of strings: option id and value.
The value must be the string representation of the a value, as understood by
`Gaudi::Property<T>::fromString()`.
For example, if an Algorithm defines two properties as in
\code
class MyAlg: public Algorithm {
Gaudi::Property<std::string> m_hname{this, "HistoName", "none"};
Gaudi::Property<float> m_threshold{this, "Threshold", 1.0};
};
\endcode
The OptionsSvc instance should be populated with something like
\code
auto& optsSvc = sericeLocator()->getOptsSvc();
optsSvc.set("AlgInstanceName.HistoName", "'my_histogram'");
optsSvc.set("AlgInstanceName.Threshold", "2.345");
\endcode
*/
struct
OptionsSvc
{
/// Set the value of an option, overriding the old value, if any.
virtual
void
set
(
const
std
::
string
&
key
,
const
std
::
string
&
value
)
=
0
;
/// Get the value of an options, returning the specified _default_ value if not found.
virtual
std
::
string
get
(
const
std
::
string
&
key
,
const
std
::
string
&
default_
=
{}
)
const
=
0
;
/// Get the value of an options, removing it from the storage, returning the specified _default_ value if not
/// found.
virtual
std
::
string
pop
(
const
std
::
string
&
key
,
const
std
::
string
&
default_
=
{}
)
=
0
;
/// Test if an option key is availble in the catalog.
virtual
bool
has
(
const
std
::
string
&
key
)
const
=
0
;
/// Return all known options with their values.
virtual
std
::
vector
<
std
::
tuple
<
std
::
string
,
std
::
string
>>
items
()
const
=
0
;
protected
:
...
...
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