35 {
36
37
38
39
40
41
42
44
45
46
47
48
49
50
51
52
53
54
55
56
57 MyDataObj *dobj = new MyDataObj;
59
60
61
63
64
65 if (
sc.isFailure() ) {
68 }
69
70
71 MyDataObj *dobj2 = new MyDataObj;
73
74
75
79 if ( !
sc.isFailure() ) {
81 (" allowed to register two default objects for type MyDataObj");
83 }
84
85
86
87 MyDataObj *dobj3 = new MyDataObj;
89
90
91
93
94
95 if (
sc.isFailure() ) {
98 }
99
100
101
102
103
104
105
106
107
108
109
111
112
113
114
115
116
117 MyContObj* mco1 = new MyContObj;
118 MyContObj* mco2 = new MyContObj;
119 mco1->
set(11.3, 132);
120 mco2->
set(41.7, 291);
121
122 DataVector<MyContObj> *cobj = new DataVector<MyContObj>;
126
127
128
129
131 if (
sc.isFailure() ) {
134 }
135
136
137
138
139
140
141 std::vector<float> *vFloat = new std::vector<float>;
142 vFloat->push_back(1.0);
143 vFloat->push_back(2.0);
144 vFloat->push_back(3.0);
145
147 if (
sc.isFailure() ) {
150 }
151
152
153
154
155
157 (*m)["uno"]=1.0;
158 (*m)["due"]=2.0;
159
161 if (
sc.isFailure() ) {
164 }
165
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223 DataLink<MyDataObj> dobjLink(*dobj);
224
225
226 dobj2 = new MyDataObj;
229
230
231 DataLink<MyDataObj> dobjLink2;
232
234
235
236
237
238
239
240
241
242 DataLink<MyDataObj> dobjLink3(
name());
243
244 (void)dobjLink3.cptr();
245
246
247
248
249 typedef ElementLink<std::vector<float> > VecElemLink;
250
251
252 VecElemLink thirdElementLink(*vFloat, 2);
253
254
255
256
257 float& anElement = vFloat->operator[](0);
258
259
260 VecElemLink aLink;
261
262 aLink.toContainedElement(*vFloat, anElement);
263
264
265
266
267
268
269
270 std::list<VecElemLink> *pLinkList = new std::list<VecElemLink>;
271 pLinkList->push_back(aLink);
272 pLinkList->push_back(thirdElementLink);
273
274
276 if (
sc.isFailure() ) {
279 }
280
281
282
283 typedef ElementLink<MapStringFloat> MapElemLink;
284 std::vector<MapElemLink>* linkVector = new std::vector<MapElemLink>;
285
286 linkVector->push_back(MapElemLink(*m, "uno"));
287 MapElemLink mLink;
288 mLink.toContainedElement(*m, (*m)["due"]);
289 linkVector->push_back(mLink);
290
292 if (
sc.isFailure() ) {
293 ATH_MSG_ERROR (
" could not register the vector of DataLinks");
295 }
296
297
298
299
300
302 if ( (
evtStore()->symLink(dobj, pDO)).isFailure() ) {
305 }
306
307
308 if ( (
evtStore()->symLink(dobj3, pDO)).isFailure() ) {
311 }
312
313
314
316 ATH_MSG_INFO (
" StoreGate structure before returning from execute \n"
318
319 return StatusCode::SUCCESS;
320}
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
std::map< std::string, float > MapStringFloat
a map of float keyed by string
ServiceHandle< StoreGateSvc > & evtStore()
void toStorableObject(const_reference data, IProxyDict *sg=0)
Set the link to an object given by a reference.
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::ostream & dump(std::ostream &out, const I4MomIter iBeg, const I4MomIter iEnd)
Helper to stream out a range of I4Momentum objects.
const std::string DEFAULTKEY