ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
ToyConversion
ToyConversion
ToyConverter.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TOYCONVERSION_TOYCONVERTER_H
6
#define TOYCONVERSION_TOYCONVERTER_H
7
8
#include "
ToyConversion/ToyConversionSvc.h
"
9
10
#include "GaudiKernel/Converter.h"
11
#include "GaudiKernel/StatusCode.h"
12
13
#include "
AthenaKernel/ClassID_traits.h
"
14
#include "
AthenaKernel/StorableConversions.h
"
15
16
template
<
class
Cnv>
class
CnvFactory
;
17
23
template
<
typename
DATA>
24
class
ToyConverter
:
public
Converter
{
25
public
:
26
// tran->per
27
// StatusCode createRep(DataObject* pO, IOpaqueAddress*& pA);
28
29
// per->tran
30
virtual
StatusCode
createObj
(IOpaqueAddress*, DataObject *& pO)
override
{
31
//could alse get DATA (perhaps as std::any) from the IOA
32
pO =
SG::asStorable
(
new
DATA);
33
return
StatusCode::SUCCESS;
34
}
35
36
static
CLID
classID
() {
return
ClassID_traits<DATA>::ID
(); }
37
38
virtual
long
int
repSvcType
()
const override
;
39
static
long
int
storageType
();
40
41
ToyConverter
(ISvcLocator* svcloc) :
42
Converter
(
storageType
(),
classID
(), svcloc) {}
43
};
44
45
46
template
<
typename
DATA>
47
long
int
ToyConverter<DATA>::storageType
() {
48
return
ToyConversionSvc::storageType
();
49
}
50
template
<
typename
DATA>
51
long
int
ToyConverter<DATA>::repSvcType
()
const
{
52
return
storageType
();
53
}
54
55
#endif
// TOYCONVERSION_TOYCONVERTER_H
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
StorableConversions.h
convert to and from a SG storable
ToyConversionSvc.h
CnvFactory
Abstract factory to create the converter.
Definition
ToyConverter.h:16
Converter::Converter
Converter()
Definition
Converter.h:29
ToyConversionSvc::storageType
static long int storageType()
Definition
ToyConversionSvc.cxx:7
ToyConverter::classID
static CLID classID()
Definition
ToyConverter.h:36
ToyConverter::ToyConverter
ToyConverter(ISvcLocator *svcloc)
Definition
ToyConverter.h:41
ToyConverter::storageType
static long int storageType()
Definition
ToyConverter.h:47
ToyConverter::repSvcType
virtual long int repSvcType() const override
Definition
ToyConverter.h:51
ToyConverter::createObj
virtual StatusCode createObj(IOpaqueAddress *, DataObject *&pO) override
Definition
ToyConverter.h:30
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
Generated on
for ATLAS Offline Software by
1.17.0