Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
155
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
34
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
Merge requests
!662
Resolve "KeyedContainer move constructor does not preserve object version"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "KeyedContainer move constructor does not preserve object version"
27-fix-keyedcontainer-move
into
v29-patches
Overview
4
Commits
1
Pipelines
3
Changes
4
1 unresolved thread
Hide all comments
Merged
Marco Clemencic
requested to merge
27-fix-keyedcontainer-move
into
v29-patches
6 years ago
Overview
4
Commits
1
Pipelines
3
Changes
4
1 unresolved thread
Hide all comments
Expand
Closes
#27 (closed)
Edited
6 years ago
by
Marco Clemencic
👍
1
👎
0
Merge request reports
Compare
v29-patches
version 1
12ceccf8
6 years ago
v29-patches (base)
and
latest version
latest version
1ec01b33
1 commit,
6 years ago
version 1
12ceccf8
1 commit,
6 years ago
4 files
+
56
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
GaudiExamples/src/FunctionalAlgorithms/TestObjectVersion.cpp
0 → 100644
+
43
−
0
Options
#include
<GaudiAlg/Consumer.h>
#include
<GaudiAlg/Producer.h>
#include
<GaudiKernel/KeyedContainer.h>
namespace
Gaudi
{
namespace
Examples
{
namespace
TestObjectVersion
{
// using ObjectType = DataObject;
using
ObjectType
=
KeyedContainer
<
KeyedObject
<
std
::
size_t
>>
;
struct
CreateObject
:
Gaudi
::
Functional
::
Producer
<
ObjectType
()
>
{
CreateObject
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
Producer
(
name
,
svcLoc
,
KeyValue
(
"OutputLocation"
,
"/Event/SomeData"
)
)
{
}
ObjectType
operator
()()
const
override
{
ObjectType
o
;
o
.
setVersion
(
42
);
info
()
<<
"Created object with version "
<<
static_cast
<
int
>
(
o
.
version
()
)
<<
endmsg
;
return
o
;
}
};
DECLARE_COMPONENT
(
CreateObject
)
struct
UseObject
:
Gaudi
::
Functional
::
Consumer
<
void
(
const
ObjectType
&
)
>
{
UseObject
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
Consumer
(
name
,
svcLoc
,
KeyValue
(
"InputLocation"
,
"/Event/SomeData"
)
)
{
}
void
operator
()(
const
ObjectType
&
o
)
const
override
{
info
()
<<
"Retrieved object with version "
<<
static_cast
<
int
>
(
o
.
version
()
)
<<
endmsg
;
if
(
o
.
version
()
!=
42
)
throw
GaudiException
(
"Wrong object version"
,
name
(),
StatusCode
::
FAILURE
);
}
};
DECLARE_COMPONENT
(
UseObject
)
}
}
}
Loading