ATLAS Offline Software
Loading...
Searching...
No Matches
ToyConverter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TOYCONVERSION_TOYCONVERTER_H
6#define TOYCONVERSION_TOYCONVERTER_H
7
9
10#include "GaudiKernel/Converter.h"
11#include "GaudiKernel/StatusCode.h"
12
15
16template <class Cnv> class CnvFactory;
17
23template <typename DATA>
24class ToyConverter : public Converter {
25public:
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 const 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
46template <typename DATA>
50template <typename DATA>
52 return storageType();
53}
54
55#endif // TOYCONVERSION_TOYCONVERTER_H
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
uint32_t CLID
The Class ID type.
convert to and from a SG storable
Abstract factory to create the converter.
static long int storageType()
ToyConverter(ISvcLocator *svcloc)
static long int storageType()
virtual long int repSvcType() const override
virtual StatusCode createObj(IOpaqueAddress *, DataObject *&pO) override
static const CLID & classID()
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)