Gaudi Framework, version v24r2
Home
Generated: Wed Dec 4 2013
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiCommonSvc
src
PersistencySvc
PersistencySvc.h
Go to the documentation of this file.
1
// ============================================================
2
//
3
// PersistencySvc.h
4
// ------------------------------------------------------------
5
//
6
// Package : PersistencySvc
7
//
8
// Author : Markus Frank
9
//
10
// ===========================================================
11
#ifndef PERSISTENCYSVC_PERSISTENCYSVC_H
12
#define PERSISTENCYSVC_PERSISTENCYSVC_H 1
13
14
// Framework include files
15
#include "
GaudiKernel/Service.h
"
16
#include "
GaudiKernel/IConversionSvc.h
"
17
#include "
GaudiKernel/IPersistencySvc.h
"
18
#include "
GaudiKernel/IAddressCreator.h
"
19
20
// STL include files
21
#include <
map
>
22
#include <
algorithm
>
23
#include <
functional
>
24
25
// Forward declarations
26
template
<
class
TYPE>
class
SvcFactory
;
27
namespace
{
template
<
class
P,
class
S>
class
Factory
; }
28
53
class
PersistencySvc
:
public
extends3
<Service,
54
IConversionSvc,
55
IPersistencySvc,
56
IAddressCreator> {
57
protected
:
58
friend
class
SvcFactory
<
PersistencySvc
>;
59
friend
class
Factory
<
PersistencySvc
,
IService
* (
std::string
,
ISvcLocator
*)>;
60
61
class
ServiceEntry
{
62
long
m_serviceType
;
63
mutable
SmartIF<IService>
m_service
;
64
mutable
SmartIF<IConversionSvc>
m_cnvService
;
65
mutable
SmartIF<IAddressCreator>
m_addrCreator
;
66
public
:
67
ServiceEntry
(
long
type
,
68
SmartIF<IService>
& svc,
69
SmartIF<IConversionSvc>
& cnv,
70
SmartIF<IAddressCreator>
& cr) {
71
m_serviceType
=
type
;
72
m_addrCreator
= cr;
73
m_cnvService
= cnv;
74
m_service
= svc;
75
}
76
ServiceEntry
(
long
type
,
77
IService
* svc,
78
IConversionSvc
* cnv,
79
IAddressCreator
* cr) {
80
m_serviceType
=
type
;
81
m_addrCreator
= cr;
82
m_cnvService
= cnv;
83
m_service
= svc;
84
}
85
ServiceEntry
(
const
ServiceEntry
& copy) {
86
m_serviceType
= copy.
m_serviceType
;
87
m_addrCreator
= copy.
m_addrCreator
;
88
m_cnvService
= copy.
m_cnvService
;
89
m_service
= copy.
m_service
;
90
}
91
virtual
~ServiceEntry
() {
92
}
93
SmartIF<IService>
&
service
()
const
{
94
return
m_service
;
95
}
96
SmartIF<IConversionSvc>
&
conversionSvc
()
const
{
97
return
m_cnvService
;
98
}
99
SmartIF<IAddressCreator>
&
addrCreator
()
const
{
100
return
m_addrCreator
;
101
}
102
long
svcType
()
const
{
103
return
m_serviceType
;
104
}
105
};
106
typedef
std::map<long,ServiceEntry>
Services
;
107
/*
108
class SvcTest : public std::unary_function<ServiceEntry, bool> {
109
public:
110
SvcTest(long test) : m_test(test) {
111
}
112
virtual ~SvcTest() {
113
}
114
bool operator()( const ServiceEntry& testee ) {
115
return m_test == testee.svcType() ? true : false;
116
}
117
protected:
118
long m_test;
119
};
120
*/
121
public
:
122
125
126
long
repSvcType
()
const
;
127
129
const
CLID
&
objType
()
const
;
130
132
virtual
StatusCode
createObj
(
IOpaqueAddress
* pAddress,
DataObject
*& refpObject);
133
135
virtual
StatusCode
fillObjRefs
(
IOpaqueAddress
* pAddress,
DataObject
* pObject);
136
138
virtual
StatusCode
updateObj
(
IOpaqueAddress
* pAddress,
DataObject
* refpObject);
139
141
virtual
StatusCode
updateObjRefs
(
IOpaqueAddress
* pAddress,
DataObject
* pObject);
142
144
virtual
StatusCode
createRep
(
DataObject
* pObject,
IOpaqueAddress
*& refpAddress);
145
147
virtual
StatusCode
fillRepRefs
(
IOpaqueAddress
* pAddress,
DataObject
* pObject);
148
150
virtual
StatusCode
updateRep
(
IOpaqueAddress
* pAddress,
DataObject
* pObject);
151
153
virtual
StatusCode
updateRepRefs
(
IOpaqueAddress
* pAddress,
DataObject
* pObject);
154
156
virtual
StatusCode
setDataProvider
(
IDataProviderSvc
* pStore);
157
159
virtual
SmartIF<IDataProviderSvc>
&
dataProvider
()
const
;
160
162
virtual
StatusCode
setConversionSvc
(
IConversionSvc
* svc);
163
165
virtual
SmartIF<IConversionSvc>
&
conversionSvc
()
const
;
166
168
virtual
StatusCode
setAddressCreator
(
IAddressCreator
* creator);
169
171
virtual
SmartIF<IAddressCreator>
&
addressCreator
()
const
;
172
174
virtual
StatusCode
addConverter
(
IConverter
* pConverter);
175
177
virtual
StatusCode
addConverter
(
const
CLID
& clid);
178
180
virtual
IConverter
*
converter
(
const
CLID
& clid);
181
183
virtual
StatusCode
removeConverter
(
const
CLID
& clid);
184
186
virtual
StatusCode
connectOutput
(
const
std::string
& outputFile,
187
const
std::string
& openMode);
189
virtual
StatusCode
connectOutput
(
const
std::string
& outputFile);
190
192
virtual
StatusCode
commitOutput
(
const
std::string
& output,
bool
do_commit);
193
195
virtual
StatusCode
createAddress
(
long
svc_type,
196
const
CLID
& clid,
197
const
std::string
* pars,
198
const
unsigned
long
* ipars,
199
IOpaqueAddress
*& refpAddress);
200
202
virtual
StatusCode
convertAddress
(
const
IOpaqueAddress
* pAddress,
203
std::string
& refAddress);
204
206
virtual
StatusCode
createAddress
(
long
svc_type,
207
const
CLID
& clid,
208
const
std::string
& refAddress,
209
IOpaqueAddress
*& refpAddress);
211
214
215
virtual
StatusCode
addCnvService
(
IConversionSvc
*
service
);
216
218
virtual
StatusCode
removeCnvService
(
long
type
);
219
221
virtual
StatusCode
setDefaultCnvService
(
long
type
);
222
224
virtual
StatusCode
getService
(
long
service_type,
IConversionSvc
*& refpSvc);
225
227
virtual
StatusCode
getService
(
const
std::string
& service_type,
IConversionSvc
*& refpSvc);
229
232
233
virtual
StatusCode
initialize
();
234
236
virtual
StatusCode
finalize
();
238
241
242
PersistencySvc
(
const
std::string
&
name
,
ISvcLocator
* svc);
243
245
virtual
~PersistencySvc
();
246
protected
:
247
249
SmartIF<IConversionSvc>
&
service
(
const
std::string
& nam);
250
252
SmartIF<IConversionSvc>
&
service
(
long
service_type);
253
255
SmartIF<IAddressCreator>
&
addressCreator
(
long
service_type);
256
258
void
encodeAddrHdr
(
long
service_type,
259
const
CLID
& clid,
260
std::string
& address)
const
;
261
263
void
decodeAddrHdr
(
const
std::string
& address,
264
long
& service_type,
265
CLID
& clid,
266
std::string
& address_trailer)
const
;
267
268
270
StatusCode
makeCall
(
int
typ,
IOpaqueAddress
*& pAddress,
DataObject
*& pObject);
271
273
bool
enable
(
bool
value);
275
277
void
svcNamesHandler
(
Property
& theProp );
278
280
long
m_cnvDefType
;
282
mutable
SmartIF<IDataProviderSvc>
m_dataSvc
;
284
Services
m_cnvServices
;
286
mutable
SmartIF<IConversionSvc>
m_cnvDefault
;
290
StringArrayProperty
m_svcNames
;
292
bool
m_enable
;
293
295
mutable
SmartIF<IAddressCreator>
m_addrCreator
;
296
};
297
#endif // PERSISTENCYSVC_PERSISTENCYSVC_H
Generated at Wed Dec 4 2013 14:33:07 for Gaudi Framework, version v24r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004