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
1329410b
Commit
1329410b
authored
7 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
Made OptionsSvc lookup case insensitive
for backward compatibility, but issuing a warning in case the wrong case is used
parent
d516f8f2
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.cpp
+14
-0
14 additions, 0 deletions
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h
+7
-3
7 additions, 3 deletions
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h
with
21 additions
and
3 deletions
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.cpp
+
14
−
0
View file @
1329410b
...
...
@@ -110,6 +110,20 @@ StatusCode JobOptionsSvc::setMyProperties( const std::string& client, IProperty*
return
fail
?
StatusCode
::
FAILURE
:
StatusCode
::
SUCCESS
;
}
JobOptionsSvc
::
StorageType
::
const_iterator
JobOptionsSvc
::
find
(
const
std
::
string
&
key
,
bool
warn
)
const
{
StorageType
::
const_iterator
iter
=
m_options
.
find
(
key
);
if
(
iter
==
m_options
.
end
()
)
{
// try case insensitive lookup
iter
=
std
::
find_if
(
m_options
.
begin
(),
m_options
.
end
(),
[
&
key
](
auto
&
item
)
{
return
Gaudi
::
Utils
::
iequal
(
item
.
first
,
key
);
}
);
if
(
warn
&&
iter
!=
m_options
.
end
()
)
{
warning
()
<<
"mismatching case for property name: actual name is "
<<
key
<<
" but "
<<
iter
->
first
<<
" is in the option files"
<<
endmsg
;
}
}
return
iter
;
}
/// Get the list of clients
std
::
vector
<
std
::
string
>
JobOptionsSvc
::
getClients
()
const
{
...
...
This diff is collapsed.
Click to expand it.
GaudiCoreSvc/src/JobOptionsSvc/JobOptionsSvc.h
+
7
−
3
View file @
1329410b
...
...
@@ -27,18 +27,22 @@ public:
typedef
std
::
vector
<
const
Gaudi
::
Details
::
PropertyBase
*>
PropertiesT
;
private:
std
::
map
<
std
::
string
,
std
::
string
>
m_options
;
using
StorageType
=
std
::
map
<
std
::
string
,
std
::
string
>
;
StorageType
m_options
;
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
;
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
override
{
auto
item
=
m_options
.
find
(
key
);
auto
item
=
find
(
key
,
true
);
return
item
!=
m_options
.
end
()
?
item
->
second
:
std
::
string
{};
}
bool
has
(
const
std
::
string
&
key
)
const
override
{
return
m_options
.
find
(
key
)
!=
m_options
.
end
();
}
bool
has
(
const
std
::
string
&
key
)
const
override
{
return
find
(
key
,
false
)
!=
m_options
.
end
();
}
public
:
// Constructor
...
...
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