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
2a1132ad
Commit
2a1132ad
authored
3 years ago
by
Gerhard Raven
Browse files
Options
Downloads
Patches
Plain Diff
keep inputLocation(int) backwards compatible for the case with one input argument
parent
6e43e1ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1291
add support for multiple input arguments to Merging{,Multi}Transformer
Pipeline
#3353790
passed
3 years ago
Stage: pre-build-checks
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiAlg/include/GaudiAlg/MergingTransformer.h
+42
-47
42 additions, 47 deletions
GaudiAlg/include/GaudiAlg/MergingTransformer.h
with
42 additions
and
47 deletions
GaudiAlg/include/GaudiAlg/MergingTransformer.h
+
42
−
47
View file @
2a1132ad
...
...
@@ -131,33 +131,38 @@ namespace Gaudi::Functional {
template
<
typename
Out
,
typename
...
Ins
,
typename
Traits_
>
struct
MergingTransformer
<
Out
(
const
vector_of_const_
<
Ins
>&
...
),
Traits_
,
false
>
:
DataHandleMixin
<
std
::
tuple
<
Out
>
,
std
::
tuple
<>
,
Traits_
>
{
private:
using
base_class
=
DataHandleMixin
<
std
::
tuple
<
Out
>
,
std
::
tuple
<>
,
Traits_
>
;
using
KeyValue
=
typename
base_class
::
KeyValue
;
using
KeyValues
=
typename
base_class
::
KeyValues
;
using
InKeys
=
details
::
RepeatValues_
<
KeyValues
,
sizeof
...(
Ins
)
>
;
public:
using
KeyValue
=
typename
base_class
::
KeyValue
;
using
KeyValues
=
typename
base_class
::
KeyValues
;
using
InKeys
=
details
::
RepeatValues_
<
KeyValues
,
sizeof
...(
Ins
)
>
;
private:
auto
construct_properties
(
InKeys
inputs
)
{
return
details
::
for_
<
sizeof
...(
Ins
)
>
(
[
&
](
auto
I
)
{
constexpr
auto
i
=
decltype
(
I
)
::
value
;
auto
&
ins
=
std
::
get
<
i
>
(
inputs
);
return
Gaudi
::
Property
<
std
::
vector
<
std
::
string
>>
{
this
,
ins
.
first
,
ins
.
second
,
[
=
](
auto
&&
)
{
auto
&
handles
=
std
::
get
<
i
>
(
this
->
m_inputs
);
auto
&
ins
=
std
::
get
<
i
>
(
this
->
m_inputLocations
);
using
Handles
=
typename
std
::
decay_t
<
decltype
(
handles
)
>
;
handles
=
make_vector_of_handles
<
Handles
>
(
this
,
ins
);
if
(
std
::
is_pointer_v
<
typename
Handles
::
value_type
>
)
{
// handle constructor does not (yet) allow to
// set
// optional flag... so do it
// explicitly here...
std
::
for_each
(
handles
.
begin
(),
handles
.
end
(),
[](
auto
&
h
)
{
h
.
setOptional
(
true
);
}
);
}
},
Gaudi
::
Details
::
Property
::
ImmediatelyInvokeHandler
{
true
}
};
}
);
}
public
:
MergingTransformer
(
std
::
string
name
,
ISvcLocator
*
locator
,
InKeys
inputs
)
:
base_class
(
std
::
move
(
name
),
locator
),
m_inputLocations
{
details
::
for_
<
sizeof
...(
Ins
)
>
(
[
&
](
auto
I
)
{
constexpr
auto
i
=
decltype
(
I
)
::
value
;
auto
&
ins
=
std
::
get
<
i
>
(
inputs
);
return
Gaudi
::
Property
<
std
::
vector
<
std
::
string
>>
{
this
,
ins
.
first
,
ins
.
second
,
[
=
](
auto
&&
)
{
auto
&
handles
=
std
::
get
<
i
>
(
this
->
m_inputs
);
auto
&
ins
=
std
::
get
<
i
>
(
this
->
m_inputLocations
);
using
In
=
typename
std
::
decay_t
<
decltype
(
handles
)
>::
value_type
;
handles
=
make_vector_of_handles
<
std
::
decay_t
<
decltype
(
handles
)
>>
(
this
,
ins
);
if
(
std
::
is_pointer_v
<
In
>
)
{
// handle constructor does not (yet) allow to set
// optional flag... so do it
// explicitly here...
std
::
for_each
(
handles
.
begin
(),
handles
.
end
(),
[](
auto
&
h
)
{
h
.
setOptional
(
true
);
}
);
}
},
Gaudi
::
Details
::
Property
::
ImmediatelyInvokeHandler
{
true
}
};
}
)
}
{
:
base_class
(
std
::
move
(
name
),
locator
),
m_inputLocations
{
construct_properties
(
inputs
)
}
{
static_assert
(
std
::
is_void_v
<
Out
>
);
}
...
...
@@ -167,25 +172,7 @@ namespace Gaudi::Functional {
}
MergingTransformer
(
std
::
string
name
,
ISvcLocator
*
locator
,
InKeys
inputs
,
const
KeyValue
&
output
)
:
base_class
(
std
::
move
(
name
),
locator
,
output
)
,
m_inputLocations
{
details
::
for_
<
sizeof
...(
Ins
)
>
(
[
&
](
auto
I
)
{
constexpr
auto
i
=
decltype
(
I
)
::
value
;
auto
&
ins
=
std
::
get
<
i
>
(
inputs
);
return
Gaudi
::
Property
<
std
::
vector
<
std
::
string
>>
{
this
,
ins
.
first
,
ins
.
second
,
[
=
](
auto
&&
)
{
auto
&
handles
=
std
::
get
<
i
>
(
this
->
m_inputs
);
auto
&
ins
=
std
::
get
<
i
>
(
this
->
m_inputLocations
);
using
In
=
typename
std
::
decay_t
<
decltype
(
handles
)
>::
value_type
;
handles
=
make_vector_of_handles
<
std
::
decay_t
<
decltype
(
handles
)
>>
(
this
,
ins
);
if
(
std
::
is_pointer_v
<
In
>
)
{
// handle constructor does not (yet) allow to set
// optional flag... so do it
// explicitly here...
std
::
for_each
(
handles
.
begin
(),
handles
.
end
(),
[](
auto
&
h
)
{
h
.
setOptional
(
true
);
}
);
}
},
Gaudi
::
Details
::
Property
::
ImmediatelyInvokeHandler
{
true
}
};
}
)
}
{
:
base_class
(
std
::
move
(
name
),
locator
,
output
),
m_inputLocations
{
construct_properties
(
inputs
)
}
{
static_assert
(
!
std
::
is_void_v
<
Out
>
);
}
...
...
@@ -196,9 +183,13 @@ namespace Gaudi::Functional {
// accessor to input Locations
const
std
::
string
&
inputLocation
(
unsigned
int
i
,
unsigned
int
j
)
const
{
return
m_inputLocations
.
value
().
at
(
i
).
at
(
j
);
return
m_inputLocations
.
at
(
i
).
value
(
).
at
(
j
);
}
unsigned
int
inputLocationSize
()
const
{
return
m_inputLocations
.
value
().
size
();
}
const
std
::
string
&
inputLocation
(
unsigned
int
i
)
const
{
static_assert
(
sizeof
...(
Ins
)
==
1
);
return
inputLocation
(
0
,
i
);
}
unsigned
int
inputLocationSize
(
int
i
=
0
)
const
{
return
m_inputLocations
.
at
(
i
).
value
().
size
();
}
// derived classes can NOT implement execute
StatusCode
execute
(
const
EventContext
&
)
const
override
final
{
...
...
@@ -289,15 +280,19 @@ namespace Gaudi::Functional {
}
)
}
{}
MergingMultiTransformer
(
std
::
string
const
&
name
,
ISvcLocator
*
pSvcLocator
,
KeyValues
inputs
,
OutKeys
outputs
)
:
MergingMultiTransformer
{
name
,
pSvcLocator
,
InKeys
{
inputs
},
std
::
move
(
outputs
)
}
{
:
MergingMultiTransformer
{
name
,
pSvcLocator
,
InKeys
{
std
::
move
(
inputs
)
},
std
::
move
(
outputs
)
}
{
static_assert
(
sizeof
...(
Ins
)
==
1
);
}
// accessor to input Locations
std
::
string
const
&
inputLocation
(
unsigned
int
i
,
unsigned
int
j
)
const
{
return
m_inputLocations
.
value
().
at
(
i
).
at
(
j
);
return
m_inputLocations
.
at
(
i
).
value
().
at
(
j
);
}
std
::
string
const
&
inputLocation
(
unsigned
int
j
)
const
{
static_assert
(
n_args
==
1
);
return
inputLocation
(
0
,
j
);
}
unsigned
int
inputLocationSize
()
const
{
return
m_inputLocations
.
value
().
size
();
}
unsigned
int
inputLocationSize
(
int
i
=
0
)
const
{
return
m_inputLocations
.
at
(
i
).
value
().
size
();
}
// derived classes can NOT implement execute
StatusCode
execute
(
EventContext
const
&
)
const
override
final
{
...
...
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