| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ConversionSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_CONVERSIONSVC_H
2 #define GAUDIKERNEL_CONVERSIONSVC_H 1
3
4 // Include files
5 #include <vector>
6 #include <algorithm>
7 #include <functional>
8 #include "GaudiKernel/Kernel.h"
9 #include "GaudiKernel/Service.h"
10 #include "GaudiKernel/IConversionSvc.h"
11 #include "GaudiKernel/IAddressCreator.h"
12 #include "GaudiKernel/IDataProviderSvc.h"
13
14
46 class GAUDI_API ConversionSvc: public extends<Service,
47 IConversionSvc,
48 IAddressCreator>
49 {
50 public:
51 class WorkerEntry final {
52 private:
53 CLID m_class;
54 IConverter* m_converter;
55 public:
56 WorkerEntry(const CLID& cl, IConverter* cnv)
57 : m_class(cl), m_converter(cnv) {
58 }
59 WorkerEntry(const WorkerEntry& copy)
60 : m_class(copy.m_class), m_converter(copy.m_converter) {
61 }
62 WorkerEntry& operator = (const WorkerEntry& copy) {
63 m_class = copy.m_class;
64 m_converter = copy.m_converter;
65 return *this;
66 }
67 IConverter* converter() {
68 return m_converter;
69 }
70 const CLID& clID() const {
71 return m_class;
72 }
73 };
74
75 class CnvTest : public std::unary_function<WorkerEntry, bool> {
76 private:
77 const CLID m_test;
78 public:
79 CnvTest(const CLID& test) : m_test(test) {
80 }
81 bool operator()( const WorkerEntry& testee ) const {
82 return m_test == testee.clID();
83 }
84 };
85
86 public:
87
89 StatusCode initialize() override;
90
92 StatusCode finalize() override;
93
95 long repSvcType() const override;
96
98 const CLID& objType() const override;
99
104 StatusCode setDataProvider(IDataProviderSvc* pService) override;
105
109 SmartIF<IDataProviderSvc>& dataProvider() const override;
110
112 StatusCode setConversionSvc(IConversionSvc* svc) override;
113
115 SmartIF<IConversionSvc>& conversionSvc() const override;
116
118 StatusCode setAddressCreator(IAddressCreator* creator) override;
119
121 SmartIF<IAddressCreator>& addressCreator() const override;
122
124 StatusCode createObj(IOpaqueAddress* pAddress,DataObject*& refpObject) override;
125
127 StatusCode fillObjRefs(IOpaqueAddress* pAddress, DataObject* pObject) override;
128
130 StatusCode updateObj(IOpaqueAddress* pAddress, DataObject* refpObject) override;
131
133 StatusCode updateObjRefs(IOpaqueAddress* pAddress, DataObject* pObject) override;
134
136 StatusCode createRep(DataObject* pObject, IOpaqueAddress*& refpAddress) override;
137
139 StatusCode fillRepRefs(IOpaqueAddress* pAddress,DataObject* pObject) override;
140
142 StatusCode updateRep(IOpaqueAddress* pAddress, DataObject* pObject) override;
143
145 StatusCode updateRepRefs(IOpaqueAddress* pAddress, DataObject* pObject) override;
146
148 StatusCode addConverter(const CLID& clid) override;
149
151 StatusCode addConverter(IConverter* pConverter) override;
152
154 StatusCode removeConverter(const CLID& clid) override;
155
157 IConverter* converter(const CLID& wanted) override;
158
160 StatusCode connectOutput(const std::string& outputFile, const std::string& openMode) override;
161
163 StatusCode connectOutput(const std::string& output) override;
164
166 StatusCode commitOutput(const std::string& output, bool do_commit) override;
167
169 StatusCode createAddress( long svc_type,
170 const CLID& clid,
171 const std::string* par,
172 const unsigned long* ip,
173 IOpaqueAddress*& refpAddress) override;
174
176 StatusCode convertAddress( const IOpaqueAddress* pAddress, std::string& refAddress) override;
177
179 StatusCode createAddress( long svc_type,
180 const CLID& clid,
181 const std::string& refAddress,
182 IOpaqueAddress*& refpAddress) override;
183
185 virtual StatusCode updateServiceState(IOpaqueAddress* pAddress);
186
188 ConversionSvc(const std::string& name, ISvcLocator* svc, long type);
189
190 protected:
192 virtual ~ConversionSvc();
193
195 virtual IConverter* createConverter(long typ, const CLID& clid, const ICnvFactory* fac);
196
198 virtual StatusCode configureConverter(long typ, const CLID& clid, IConverter* cnv);
199
201 virtual StatusCode initializeConverter(long typ, const CLID& clid, IConverter* cnv);
202
204 virtual StatusCode activateConverter(long typ, const CLID& clid, IConverter* cnv);
205
207 virtual void loadConverter(DataObject* pObject);
208
210 virtual SmartIF<IAddressCreator>& addressCreator() {
211 return m_addressCreator;
212 }
213
214 protected:
215 StatusCode makeCall( int typ,
216 bool ignore_add,
217 bool ignore_obj,
218 bool update,
219 IOpaqueAddress*& pAddress,
220 DataObject*& pObject);
221
223 mutable SmartIF<IDataProviderSvc> m_dataSvc;
225 mutable SmartIF<IAddressCreator> m_addressCreator;
227 mutable SmartIF<IConversionSvc> m_cnvSvc;
229 long m_type;
231 std::vector<WorkerEntry> m_workers;
232
233 private:
235 ConversionSvc(const ConversionSvc&);
237 ConversionSvc& operator= (const ConversionSvc&);
238 };
239 #endif // GAUDIKERNEL_CONVERSIONSVC_H
ConversionSvc::WorkerEntry::converter
IConverter * converter()
Definition: ConversionSvc.h:67
SmartIF< IDataProviderSvc >
Kernel.h
ConversionSvc::addressCreator
virtual SmartIF< IAddressCreator > & addressCreator()
Retrieve address creation interface.
Definition: ConversionSvc.h:210
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
IConverter
The data converters are responsible to translate data from one representation into another...
Definition: IConverter.h:57
ConversionSvc::CnvTest
Definition: ConversionSvc.h:75
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
IConversionSvc
Definition: IConversionSvc.h:37
gaudirun.output
output
Definition: gaudirun.py:388
IAddressCreator
IAddressCreator interface definition.
Definition: IAddressCreator.h:28
ConversionSvc::WorkerEntry::clID
const CLID & clID() const
Definition: ConversionSvc.h:70
ConversionSvc::WorkerEntry
Definition: ConversionSvc.h:51
ConversionSvc::m_addressCreator
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
Definition: ConversionSvc.h:225
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
operator=
PropertyMgr & operator=(const PropertyMgr &)=delete
std::string
STL class.
Service.h
ConversionSvc::WorkerEntry::m_class
CLID m_class
Definition: ConversionSvc.h:53
ConversionSvc::CnvTest::m_test
const CLID m_test
Definition: ConversionSvc.h:77
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
IDataProviderSvc.h
compareRootHistos.test
string test
Definition: compareRootHistos.py:15
ConversionSvc::WorkerEntry::WorkerEntry
WorkerEntry(const WorkerEntry &copy)
Definition: ConversionSvc.h:59
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ConversionSvc::CnvTest::operator()
bool operator()(const WorkerEntry &testee) const
Definition: ConversionSvc.h:81
gaudirun.type
type
Definition: gaudirun.py:125
ConversionSvc::WorkerEntry::WorkerEntry
WorkerEntry(const CLID &cl, IConverter *cnv)
Definition: ConversionSvc.h:56
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
ConversionSvc::CnvTest::CnvTest
CnvTest(const CLID &test)
Definition: ConversionSvc.h:79
ConversionSvc::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
Definition: ConversionSvc.h:223
std::vector
STL class.
IAddressCreator.h
IConversionSvc.h
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
ConversionSvc::m_cnvSvc
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
Definition: ConversionSvc.h:227
ConversionSvc::m_type
long m_type
Conversion service type.
Definition: ConversionSvc.h:229
std::unary_function
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
ConversionSvc
Base class for all conversion services.
Definition: ConversionSvc.h:46
ConversionSvc::m_workers
std::vector< WorkerEntry > m_workers
List of conversion workers.
Definition: ConversionSvc.h:231
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ConversionSvc::WorkerEntry::m_converter
IConverter * m_converter
Definition: ConversionSvc.h:54
GaudiPython.Pythonizations.update
update
Definition: Pythonizations.py:94