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
a8e9986c
Commit
a8e9986c
authored
1 year ago
by
Marco Clemencic
Browse files
Options
Downloads
Plain Diff
genconf: remove property type comment from Conf files
See merge request
!1502
parents
19d07bb0
8d30e248
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1502
genconf: remove property type comment from Conf files
Pipeline
#6366568
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiKernel/src/Util/genconf.cpp
+10
-18
10 additions, 18 deletions
GaudiKernel/src/Util/genconf.cpp
with
10 additions
and
18 deletions
GaudiKernel/src/Util/genconf.cpp
+
10
−
18
View file @
a8e9986c
/***********************************************************************************\
* (c) Copyright 1998-202
2
CERN for the benefit of the LHCb and ATLAS collaborations *
* (c) Copyright 1998-202
3
CERN for the benefit of the LHCb and ATLAS collaborations *
* *
* This software is distributed under the terms of the Apache version 2 licence, *
* copied verbatim in the file "LICENSE". *
...
...
@@ -251,7 +251,7 @@ private:
void
genTrailer
(
std
::
ostream
&
pyOut
,
std
::
ostream
&
dbOut
);
/// handle the "marshalling" of Properties
void
pythonizeValue
(
const
PropertyBase
*
prop
,
string
&
pvalue
,
string
&
ptype
,
string
&
ptype2
);
void
pythonizeValue
(
const
PropertyBase
*
prop
,
string
&
pvalue
,
string
&
ptype
);
};
int
createAppMgr
();
...
...
@@ -728,11 +728,11 @@ bool configGenerator::genComponent( const std::string& libName, const std::strin
return
false
;
}
string
pvalue
,
ptype
,
ptype2
;
pythonizeValue
(
prop
,
pvalue
,
ptype
,
ptype2
);
m_pyBuf
<<
" '"
<<
pname
<<
"' : "
<<
pvalue
<<
",
# "
<<
ptype
<<
"
\n
"
;
string
pvalue
,
ptype
;
pythonizeValue
(
prop
,
pvalue
,
ptype
);
m_pyBuf
<<
" '"
<<
pname
<<
"' : "
<<
pvalue
<<
",
\n
"
;
m_db2Buf
<<
" '"
<<
pname
<<
"': ('"
<<
ptype
2
<<
"', "
<<
pvalue
<<
", '''"
<<
prop
->
documentation
()
m_db2Buf
<<
" '"
<<
pname
<<
"': ('"
<<
ptype
<<
"', "
<<
pvalue
<<
", '''"
<<
prop
->
documentation
()
<<
" ["
<<
prop
->
ownerTypeName
()
<<
"]'''"
;
auto
sem
=
prop
->
semantics
();
if
(
!
sem
.
empty
()
)
{
m_db2Buf
<<
", '"
<<
sem
<<
'\''
;
}
...
...
@@ -775,22 +775,20 @@ bool configGenerator::genComponent( const std::string& libName, const std::strin
}
//-----------------------------------------------------------------------------
void
configGenerator
::
pythonizeValue
(
const
PropertyBase
*
p
,
string
&
pvalue
,
string
&
ptype
,
string
&
ptype2
)
void
configGenerator
::
pythonizeValue
(
const
PropertyBase
*
p
,
string
&
pvalue
,
string
&
ptype
)
//-----------------------------------------------------------------------------
{
const
std
::
string
cvalue
=
p
->
toString
();
const
std
::
type_index
ti
=
std
::
type_index
(
*
p
->
type_info
()
);
ptype
2
=
System
::
typeinfoName
(
*
p
->
type_info
()
);
ptype
=
System
::
typeinfoName
(
*
p
->
type_info
()
);
if
(
ti
==
typeIndex
<
bool
>
()
)
{
pvalue
=
(
cvalue
==
"0"
||
cvalue
==
"False"
||
cvalue
==
"false"
)
?
"False"
:
"True"
;
ptype
=
"bool"
;
}
else
if
(
ti
==
typeIndex
<
char
>
()
||
ti
==
typeIndex
<
signed
char
>
()
||
ti
==
typeIndex
<
unsigned
char
>
()
||
ti
==
typeIndex
<
short
>
()
||
ti
==
typeIndex
<
unsigned
short
>
()
||
ti
==
typeIndex
<
int
>
()
||
ti
==
typeIndex
<
unsigned
int
>
()
||
ti
==
typeIndex
<
long
>
()
||
ti
==
typeIndex
<
unsigned
long
>
()
||
ti
==
typeIndex
<
long
long
>
()
||
ti
==
typeIndex
<
unsigned
long
long
>
()
)
{
pvalue
=
cvalue
;
ptype
=
"int"
;
}
else
if
(
ti
==
typeIndex
<
float
>
()
||
ti
==
typeIndex
<
double
>
()
)
{
// forces python to handle this as a float: put a dot in there...
pvalue
=
boost
::
to_lower_copy
(
cvalue
);
...
...
@@ -799,39 +797,33 @@ void configGenerator::pythonizeValue( const PropertyBase* p, string& pvalue, str
}
else
if
(
std
::
string
::
npos
==
pvalue
.
find
(
"."
)
&&
std
::
string
::
npos
==
pvalue
.
find
(
"e"
)
)
{
pvalue
=
cvalue
+
".0"
;
}
ptype
=
"float"
;
}
else
if
(
ti
==
typeIndex
<
string
>
()
)
{
pvalue
=
quote
(
cvalue
);
ptype
=
"str"
;
}
else
if
(
ti
==
typeIndex
<
GaudiHandleBase
>
()
)
{
const
GaudiHandleProperty
&
hdl
=
dynamic_cast
<
const
GaudiHandleProperty
&>
(
*
p
);
const
GaudiHandleBase
&
base
=
hdl
.
value
();
pvalue
=
base
.
pythonRepr
();
ptype
=
"GaudiHandle"
;
ptype2
=
base
.
pythonPropertyClassName
();
ptype
=
base
.
pythonPropertyClassName
();
m_importGaudiHandles
=
true
;
}
else
if
(
ti
==
typeIndex
<
GaudiHandleArrayBase
>
()
)
{
const
GaudiHandleArrayProperty
&
hdl
=
dynamic_cast
<
const
GaudiHandleArrayProperty
&>
(
*
p
);
const
GaudiHandleArrayBase
&
base
=
hdl
.
value
();
pvalue
=
base
.
pythonRepr
();
ptype
=
"GaudiHandleArray"
;
ptype2
=
base
.
pythonPropertyClassName
();
ptype
=
base
.
pythonPropertyClassName
();
m_importGaudiHandles
=
true
;
}
else
if
(
auto
hdl
=
dynamic_cast
<
const
DataHandleProperty
*>
(
p
);
hdl
)
{
// dynamic_cast to support also classes derived from DataHandleProperty
const
Gaudi
::
DataHandle
&
base
=
hdl
->
value
();
pvalue
=
base
.
pythonRepr
();
ptype
=
"DataHandle"
;
m_importDataHandles
=
true
;
}
else
{
std
::
ostringstream
v_str
;
v_str
.
setf
(
std
::
ios
::
showpoint
);
// to correctly display floats
p
->
toStream
(
v_str
);
pvalue
=
v_str
.
str
();
ptype
=
"list"
;
}
}
...
...
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