| The Gaudi Framework v32r1 (f65d50dc)

KeyedObjectManager.cpp
Go to the documentation of this file.
1 // Include files
2 #include "GaudiKernel/KeyedObjectManager.h"
3 #include "GaudiKernel/ContainedObject.h"
4 #include "GaudiKernel/GaudiException.h"
5 #include "GaudiKernel/HashMap.h"
6 #include "GaudiKernel/Kernel.h"
7 #include <algorithm>
8 #include <map>
9
10 namespace Containers {
11 struct hashmap {
12 typedef GaudiUtils::HashMap<long, void*> map_type;
13 map_type m;
14 std::vector<void*> v;
15 bool insert( void* obj, long key ) {
16 auto p = m.insert( map_type::value_type( key, obj ) );
17 return p.second;
18 }
19 hashmap() = default;
20 hashmap( hashmap&& ) = default;
21 };
22 struct map {
23 typedef std::map<long, void*> map_type;
24 map_type m;
25 std::vector<void*> v;
26 bool insert( void* obj, long key ) {
27 auto p = m.insert( map_type::value_type( key, obj ) );
28 return p.second;
29 }
30 map() = default;
31 map( map&& ) = default;
32 };
33 struct array {
34 typedef std::vector<long> map_type;
36 std::vector<long> m_idx;
38 std::vector<void*> v;
39 struct decrement {
40 long m_min;
41 decrement( long m ) : m_min( m ) {}
42 bool operator()( long& j ) const {
43 if ( j > m_min ) --j;
44 return true;
45 }
46 };
47 array() = default;
48 array( array&& ) = default;
49 };
50 struct vector {
51 typedef std::vector<void*> map_type;
53 std::vector<void*> v;
54 vector() = default;
55 vector( vector&& ) = default;
56 };
57
58 template <class CONT>
59 class find {
60 const void* m_obj;
61 typedef typename CONT::value_type v_type;
62
63 public:
64 find( const void* o ) : m_obj( o ) {}
65 bool operator()( const void* cmp ) const { return cmp == m_obj; }
66 bool operator()( const v_type& cmp ) const { return ( *this )( cmp.second ); }
67 };
68 } // namespace Containers
69 void Containers::cannotAssignObjectKey() {
70 throw GaudiException( "Cannot assign key to keyed object! Object already has a key.", "KeyedObject",
71 StatusCode::FAILURE );
72 }
73 void Containers::cannotInsertToContainer() {
74 throw GaudiException( "Cannot insert element to Keyed Container!", "KeyedContainer", StatusCode::FAILURE );
75 }
76
77 void Containers::containerIsInconsistent() {
78 throw GaudiException( "Keyed Container structures are inconsistent - severe problem!", "KeyedContainer",
79 StatusCode::FAILURE );
80 }
81
82 void Containers::invalidContainerOperation() {
83 throw GaudiException( "Keyed Container cannot satisfy request - severe problem!", "KeyedContainer",
84 StatusCode::FAILURE );
85 }
86
87 template <class T>
88 Containers::KeyedObjectManager<T>::KeyedObjectManager() : m_seq( nullptr ), m_direct( 0 ) {
89 if ( sizeof( typename T::map_type ) > sizeof( m_setup.buffer ) ) {
90 throw GaudiException( "Basic STL contaier sizes are incompatible", "KeyedContainer", StatusCode::FAILURE );
91 }
92 m_setup.s = ::new ( m_setup.buffer + sizeof( m_setup.s ) ) T();
93 m_keyCtxt = -1;
94 }
95
96 template <class T>
97 Containers::KeyedObjectManager<T>::KeyedObjectManager( KeyedObjectManager&& other )
98 : m_seq( nullptr ), m_direct( other.m_direct ), m_keyCtxt( other.m_keyCtxt ) {
99 m_setup.s = ::new ( m_setup.buffer + sizeof( m_setup.s ) ) T( std::move( *other.m_setup.s ) );
100
101 other.m_keyCtxt = -1;
102 other.m_seq = nullptr;
103 other.m_direct = 0;
104 }
105
106 template <class T>
107 Containers::KeyedObjectManager<T>::~KeyedObjectManager() {
108 m_setup.s->~T();
109 }
110
112 template <class T>
113 void Containers::KeyedObjectManager<T>::setup( void* seq, void** rndm ) {
114 m_seq = (seq_type*)seq;
115 *rndm = &m_setup.s->v;
116 }
117
118 template <class T>
119 void Containers::KeyedObjectManager<T>::onDirty() const {
120 m_direct = 1;
121 auto& s = *m_setup.s;
122 long i = 0;
123 for ( auto p : s.v ) s.insert( p, i++ );
124 s.v.clear();
125 }
126
127 template <class T>
128 long Containers::KeyedObjectManager<T>::insert( ObjectContainerBase* pBase, ContainedObject* pObject, void* obj,
129 long* key ) {
130 *key = ++m_keyCtxt;
131 return insert( pBase, pObject, obj, *key );
132 }
133
134 template <class T>
135 long Containers::KeyedObjectManager<T>::insert( ObjectContainerBase* pBase, ContainedObject* pObject, void* obj,
136 long key ) {
138 if ( key > m_keyCtxt ) { m_keyCtxt = key; }
139 if ( 1 == m_direct ) {
140 if ( m_setup.s->insert( obj, key ) ) {
141 if ( !pObject->parent() ) { pObject->setParent( pBase ); }
142 m_seq->push_back( obj );
143 return OBJ_INSERTED;
144 }
145 } else if ( key == long( m_setup.s->v.size() ) ) {
146 m_setup.s->v.push_back( obj );
147 if ( !pObject->parent() ) { pObject->setParent( pBase ); }
148 m_seq->push_back( obj );
149 return OBJ_INSERTED;
150 } else {
151 // Document is dirty now...
152 // need to copy all pointers from the vector to the map
153 onDirty();
154 return insert( pBase, pObject, obj, key );
155 }
156 cannotInsertToContainer();
157 return OBJ_CANNOT_INSERT;
158 }
159
160 template <class T>
161 long Containers::KeyedObjectManager<T>::insertDirect( ObjectContainerBase* pBase, ContainedObject* pObject, void* obj,
162 long key ) {
164 if ( key > m_keyCtxt ) { m_keyCtxt = key; }
165 if ( 1 == m_direct ) {
166 if ( m_setup.s->insert( obj, key ) ) {
167 if ( !pObject->parent() ) { pObject->setParent( pBase ); }
168 return OBJ_INSERTED;
169 }
170 } else if ( key == long( m_setup.s->v.size() ) ) {
171 m_setup.s->v.push_back( obj );
172 if ( !pObject->parent() ) { pObject->setParent( pBase ); }
173 return OBJ_INSERTED;
174 } else {
175 // Document is dirty now...
176 // need to copy all pointers from the vector to the map
177 onDirty();
178 return insertDirect( pBase, pObject, obj, key );
179 }
180 cannotInsertToContainer();
181 return OBJ_CANNOT_INSERT;
182 }
183
184 // Remove object from container
185 template <class T>
186 void* Containers::KeyedObjectManager<T>::erase( long key, const void* obj ) {
187 typedef typename T::map_type MTYP;
188 typedef find<MTYP> FND;
189 if ( 1 == m_direct ) {
190 auto& m = m_setup.s->m;
191 auto i = ( obj ? std::find_if( m.begin(), m.end(), FND( obj ) ) : m_setup.s->m.find( key ) );
192 if ( i != m_setup.s->m.end() ) {
193 void* o = i->second;
194 auto j = std::find( m_seq->begin(), m_seq->end(), o );
195 if ( j != m_seq->end() ) {
196 m_seq->erase( j );
197 m_setup.s->m.erase( i );
198 return o;
199 }
200 }
201 containerIsInconsistent();
202 }
203 onDirty();
204 return erase( key, obj );
205 }
206
207 template <class T>
208 void* Containers::KeyedObjectManager<T>::object( long key ) const {
209 if ( 0 == m_direct ) onDirty();
210 auto i = m_setup.s->m.find( key );
211 if ( i != m_setup.s->m.end() ) return ( *i ).second;
212 return nullptr;
213 }
214
215 template <class T>
216 void Containers::KeyedObjectManager<T>::reserve( long len ) {
217 switch ( m_direct ) {
218 case 1:
219 break;
220 case 0:
221 m_setup.s->v.reserve( len );
222 break;
223 default:
224 break;
225 }
226 m_seq->reserve( len );
227 }
228
229 template <class T>
230 void Containers::KeyedObjectManager<T>::clear() {
231 clearDirect();
232 m_seq->clear();
233 }
234
235 template <class T>
236 void Containers::KeyedObjectManager<T>::clearDirect() {
237 switch ( m_direct ) {
238 case 1:
239 m_setup.s->m.clear();
240 break;
241 case 0:
242 m_setup.s->v.clear();
243 break;
244 default:
245 break;
246 }
247 m_direct = 0;
248 m_keyCtxt = -1;
249 }
250
251 // Remove object by sequential iterators
252 template <class T>
253 long Containers::KeyedObjectManager<T>::erase( seq_type::iterator beg, seq_type::iterator end ) {
254 typedef typename T::map_type MTYP;
255 typedef find<MTYP> FND;
256 if ( 0 == m_direct ) {
257 onDirty();
258 return erase( beg, end );
259 }
260 if ( beg == m_seq->begin() && end == m_seq->end() ) {
261 clear();
262 } else {
263 for ( auto j = beg; j != end; ++j ) {
264 // auto& m = m_setup.s->m;
265 auto i = std::find_if( m_setup.s->m.begin(), m_setup.s->m.end(), FND( *j ) );
266 if ( i != m_setup.s->m.end() ) {
267 m_setup.s->m.erase( i );
268 continue;
269 }
270 containerIsInconsistent();
271 }
272 m_seq->erase( beg, end );
273 }
274 return OBJ_ERASED;
275 }
276
277 namespace Containers {
278
279 /* First specialize static methods and then instantiate templated class to appear as symbols in the library
280 This order in needed for gcc 4.0 (MacOSX) */
281
282 template <>
283 CLID KeyedObjectManager<Containers::map>::classID() {
284 return CLID_ObjectVector + 0x00030000;
285 }
286 template <>
287 CLID KeyedObjectManager<Containers::hashmap>::classID() {
288 return CLID_ObjectVector + 0x00040000;
289 }
290
291 template class KeyedObjectManager<Containers::hashmap>;
292 template class KeyedObjectManager<Containers::map>;
293 } // namespace Containers
294
295 /*
296 *
297 *
298 * Inline code for indirection array implementation
299 *
300 */
301 typedef Containers::array __A;
302
303 namespace Containers {
304
305 //__forceinline
306 template <>
307 void* KeyedObjectManager<__A>::object( long value ) const {
308 #ifdef CHECK_KEYED_CONTAINER
309 unsigned long siz = m_setup.s->m_idx.size();
310 if ( value >= 0 && size_t( value ) < siz ) {
311 long ent = *( m_setup.s->m_idx.begin() + value );
312 if ( ent >= 0 ) { return *( m_setup.s->v.begin() + ent ); }
313 }
314 return nullptr;
315 #else
316 return *( m_setup.s->v.begin() + ( *( m_setup.s->m_idx.begin() + value ) ) );
317 #endif
318 }
319
320 template <>
321 void KeyedObjectManager<__A>::onDirty() const {
322 m_direct = 1;
323 m_setup.s->m_idx.reserve( m_setup.s->v.size() + 1 );
324 for ( int i = 0, stop = m_setup.s->v.size(); i < stop; ++i ) {
325 if ( !m_setup.s->v[i] ) { containerIsInconsistent(); }
326 m_setup.s->m_idx.push_back( i );
327 }
328 }
329
330 // Insert new object into container
331 template <>
332 long KeyedObjectManager<__A>::insert( ObjectContainerBase* b, ContainedObject* c, void* o, long* k ) {
333 // auto key creation only possible for direct access!
334 if ( 0 == m_direct ) {
335 m_seq->push_back( o );
336 m_setup.s->v.push_back( o );
337 if ( !c->parent() ) c->setParent( b );
338 *k = ++m_keyCtxt;
339 return OBJ_INSERTED;
340 }
341 cannotInsertToContainer();
342 return OBJ_CANNOT_INSERT;
343 }
344
345 // Insert new object into container
346 template <>
347 long KeyedObjectManager<__A>::insert( ObjectContainerBase* b, ContainedObject* c, void* o, long k ) {
348 if ( 0 == m_direct ) {
349 if ( k == m_keyCtxt + 1 ) { return insert( b, c, o, &k ); }
350 onDirty();
351 return insert( b, c, o, k );
352 }
354 if ( k > m_keyCtxt ) m_keyCtxt = k;
356 if ( k + 1 > long( m_setup.s->m_idx.size() ) ) { m_setup.s->m_idx.resize( k + 1, -1 ); }
357 auto idx = m_setup.s->m_idx.begin() + k;
358 if ( *idx == -1 ) {
359 *idx = m_setup.s->v.size();
360 m_setup.s->v.push_back( o );
361 m_seq->push_back( o );
362 if ( !c->parent() ) c->setParent( b );
363 return OBJ_INSERTED;
364 }
365 cannotInsertToContainer();
366 return OBJ_CANNOT_INSERT;
367 }
368
369 // Insert new object into container
370 template <>
371 long KeyedObjectManager<__A>::insertDirect( ObjectContainerBase* b, ContainedObject* c, void* o, long k ) {
372 if ( 0 == m_direct ) {
373 if ( k == m_keyCtxt + 1 ) {
374 m_setup.s->v.push_back( o );
375 if ( !c->parent() ) c->setParent( b );
376 ++m_keyCtxt;
377 return OBJ_INSERTED;
378 }
379 onDirty();
380 return insertDirect( b, c, o, k );
381 }
383 if ( k > m_keyCtxt ) m_keyCtxt = k;
385 if ( k + 1 > long( m_setup.s->m_idx.size() ) ) { m_setup.s->m_idx.resize( k + 1, -1 ); }
386 auto idx = m_setup.s->m_idx.begin() + k;
387 if ( *idx == -1 ) {
388 *idx = m_setup.s->v.size();
389 m_setup.s->v.push_back( o );
390 if ( !c->parent() ) c->setParent( b );
391 return OBJ_INSERTED;
392 }
393 cannotInsertToContainer();
394 return OBJ_CANNOT_INSERT;
395 }
396
397 // Clear content of the vector
398 template <>
399 void KeyedObjectManager<__A>::clearDirect() {
400 m_setup.s->v.clear();
401 m_setup.s->m_idx.clear();
402 m_direct = 0;
403 m_keyCtxt = -1;
404 }
405
406 // Remove object from container (very inefficient if key is invalid)
407 template <>
408 void* KeyedObjectManager<__A>::erase( long key, const void* obj ) {
409 if ( 0 == m_direct ) {
410 onDirty();
411 return erase( key, obj );
412 }
413 if ( obj ) {
414 auto& idx = m_setup.s->m_idx;
415 for ( auto& elem : idx ) {
416 auto j = m_setup.s->v.begin() + ( elem );
417 auto k = std::find( m_seq->begin(), m_seq->end(), *j );
418 if ( *j == obj ) {
419 void* o = *j;
420 m_seq->erase( k );
421 m_setup.s->v.erase( j );
422 std::for_each( m_setup.s->m_idx.begin(), m_setup.s->m_idx.end(), array::decrement( elem ) );
423 elem = -1;
424 return o;
425 }
426 }
427 } else if ( key >= 0 && key < long( m_setup.s->m_idx.size() ) ) {
428 auto idx = m_setup.s->m_idx.begin() + key;
429 if ( *idx != -1 ) {
430 auto i = m_setup.s->v.begin() + ( *idx );
431 if ( i == m_setup.s->v.end() ) { containerIsInconsistent(); }
432 void* o = *i;
433 auto j = std::find( m_seq->begin(), m_seq->end(), o );
434 if ( j == m_seq->end() ) { containerIsInconsistent(); }
435 m_seq->erase( j );
436 m_setup.s->v.erase( i );
437 std::for_each( m_setup.s->m_idx.begin(), m_setup.s->m_idx.end(), array::decrement( *idx ) );
438 *idx = -1;
439 return o;
440 }
441 }
442 containerIsInconsistent();
443 return nullptr;
444 }
445
446 // Remove object by sequential iterators
447 template <>
448 long KeyedObjectManager<__A>::erase( seq_type::iterator beg, seq_type::iterator end ) {
449 if ( beg == m_seq->begin() && end == m_seq->end() ) {
450 clear();
451 return OBJ_ERASED;
452 } else if ( 0 == m_direct ) {
453 onDirty();
454 return erase( beg, end );
455 } else {
456 long cnt = 0, nobj = end - beg;
457 auto& idx = m_setup.s->m_idx;
458 for ( auto& elem : idx ) {
459 auto j = m_setup.s->v.begin() + ( elem );
460 auto k = std::find( beg, end, *j );
461 if ( k != end ) {
462 m_setup.s->v.erase( j );
463 std::for_each( m_setup.s->m_idx.begin(), m_setup.s->m_idx.end(), array::decrement( elem ) );
464 elem = -1;
465 cnt++;
466 if ( cnt == nobj ) break;
467 }
468 }
469 m_seq->erase( beg, end );
470 if ( cnt != nobj ) { containerIsInconsistent(); }
471 return OBJ_ERASED;
472 }
473 // cannot reach this point
474 }
475
476 template <>
477 CLID KeyedObjectManager<__A>::classID() {
478 return CLID_ObjectVector + 0x00050000;
479 }
480 } // namespace Containers
481 template class Containers::KeyedObjectManager<__A>;
482 /*
483 *
484 *
485 * Implementation for objects with vector like access
486 *
487 *
488 **/
489 typedef Containers::vector __V;
490
491 namespace Containers {
492 // Access single entry by long(integer) key
493 template <>
494 void* KeyedObjectManager<__V>::object( long /* value */ ) const {
495 invalidContainerOperation();
496 return nullptr;
497 }
498
499 template <>
500 void KeyedObjectManager<__V>::onDirty() const {
501 invalidContainerOperation();
502 }
503
504 // Insert new object into container
505 template <>
506 long KeyedObjectManager<__V>::insert( ObjectContainerBase* b, ContainedObject* c, void* o, long* k ) {
507 m_seq->push_back( o );
508 m_setup.s->v.push_back( o );
509 if ( !c->parent() ) c->setParent( b );
510 *k = ( m_setup.s->v.size() - 1 );
511 return OBJ_INSERTED;
512 }
513
514 // Insert new object into container
515 template <>
516 long KeyedObjectManager<__V>::insert( ObjectContainerBase* b, ContainedObject* c, void* o, long k ) {
517 if ( k == long( m_setup.s->v.size() ) ) { return insert( b, c, o, &k ); }
518 cannotInsertToContainer();
519 return OBJ_CANNOT_INSERT;
520 }
521
522 // Insert new object into container
523 template <>
524 long KeyedObjectManager<__V>::insertDirect( ObjectContainerBase* b, ContainedObject* c, void* o, long k ) {
525 if ( k == long( m_setup.s->v.size() ) ) {
526 m_setup.s->v.push_back( o );
527 if ( !c->parent() ) c->setParent( b );
528 return OBJ_INSERTED;
529 }
530 cannotInsertToContainer();
531 return OBJ_CANNOT_INSERT;
532 }
533
534 // Clear content of the vector
535 template <>
536 void KeyedObjectManager<__V>::clearDirect() {
537 m_setup.s->v.clear();
538 m_direct = 0;
539 m_keyCtxt = -1;
540 }
541
542 // Remove object from container (very inefficient if key is invalid)
543 template <>
544 void* KeyedObjectManager<__V>::erase( long /* key */, const void* /* obj */ ) {
545 invalidContainerOperation();
546 return nullptr;
547 }
548
549 // Remove object by sequential iterators
550 template <>
551 long KeyedObjectManager<__V>::erase( seq_type::iterator beg, seq_type::iterator end ) {
552 if ( beg == m_seq->begin() && end == m_seq->end() ) {
553 clear();
554 return OBJ_ERASED;
555 }
556 invalidContainerOperation();
557 return OBJ_ERASED;
558 }
559
560 template <>
561 CLID KeyedObjectManager<__V>::classID() {
562 return CLID_ObjectVector + 0x00060000;
563 }
564 } // namespace Containers
565 template class Containers::KeyedObjectManager<__V>;
Containers::array::array
array()=default
Containers::map::map
map()=default
Kernel.h
__V
Containers::vector __V
Definition: KeyedObjectManager.cpp:489
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
Containers::hashmap::v
std::vector< void * > v
Definition: KeyedObjectManager.cpp:14
gaudirun.c
c
Definition: gaudirun.py:487
Containers::vector::map_type
std::vector< void * > map_type
Definition: KeyedObjectManager.cpp:51
Containers::KeyedObjectManager::~KeyedObjectManager
virtual ~KeyedObjectManager()
Standard Destructor.
Definition: KeyedObjectManager.cpp:107
Containers::KeyedObjectManager::clear
void clear()
Clear content of the vector.
Definition: KeyedObjectManager.cpp:230
Containers::find::v_type
CONT::value_type v_type
Definition: KeyedObjectManager.cpp:61
ManySmallAlgs.seq
seq
Definition: ManySmallAlgs.py:89
Containers::array::map_type
std::vector< long > map_type
Definition: KeyedObjectManager.cpp:34
Containers::vector::vector
vector()=default
Gaudi::Functional::details::insert
constexpr struct Gaudi::Functional::details::insert_t insert
Containers::containerIsInconsistent
GAUDI_API void containerIsInconsistent()
Function to be called to indicate that the container is found to be inconsistent.
Definition: KeyedObjectManager.cpp:77
Containers::hashmap::hashmap
hashmap()=default
Containers::hashmap::m
map_type m
Definition: KeyedObjectManager.cpp:13
Containers::KeyedObjectManager::clearDirect
void clearDirect()
Clear all direct access fields.
Definition: KeyedObjectManager.cpp:236
Containers::find::m_obj
const void * m_obj
Definition: KeyedObjectManager.cpp:60
Containers::array::decrement::operator()
bool operator()(long &j) const
Definition: KeyedObjectManager.cpp:42
Containers::array::m_idx
std::vector< long > m_idx
Indirection array.
Definition: KeyedObjectManager.cpp:36
Containers::KeyedObjectManager::erase
void * erase(long key, const void *obj)
Remove object from container (very inefficient if key is invalid)
Definition: KeyedObjectManager.cpp:186
Containers::map::map_type
std::map< long, void * > map_type
Definition: KeyedObjectManager.cpp:23
HashMap.h
Containers
Containers namespace.
Definition: KeyedObjectManager.h:18
Containers::OBJ_INSERTED
Object was inserted into the container.
Definition: KeyedTraits.h:26
std::map< long, void * >
Containers::array
Definition: KeyedObjectManager.cpp:33
Containers::hashmap
Definition: KeyedObjectManager.cpp:11
Containers::hashmap::insert
bool insert(void *obj, long key)
Definition: KeyedObjectManager.cpp:15
Containers::cannotInsertToContainer
GAUDI_API void cannotInsertToContainer()
Function to be called to indicate that an object cannot be inserted to the container.
Definition: KeyedObjectManager.cpp:73
Containers::KeyedObjectManager::onDirty
void onDirty() const
Callback when the container becomes dirty.
Definition: KeyedObjectManager.cpp:119
Containers::KeyedObjectManager::object
void * object(long key) const
Retrieve object identified by a key from the container.
Definition: KeyedObjectManager.cpp:208
Containers::vector::v
std::vector< void * > v
Direct access array.
Definition: KeyedObjectManager.cpp:53
GaudiUtils::Map::insert
std::pair< iterator, bool > insert(ValueType &&val)
Definition: Map.h:168
Containers::KeyedObjectManager::reserve
void reserve(long size)
Reserve buffer space.
Definition: KeyedObjectManager.cpp:216
Containers::invalidContainerOperation
GAUDI_API void invalidContainerOperation()
Function to be called to indicate that an operation should be performed on the container or it's cont...
Definition: KeyedObjectManager.cpp:82
Containers::find::operator()
bool operator()(const void *cmp) const
Definition: KeyedObjectManager.cpp:65
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:92
Containers::array::decrement::decrement
decrement(long m)
Definition: KeyedObjectManager.cpp:41
GaudiException.h
Containers::hashmap::map_type
GaudiUtils::HashMap< long, void * > map_type
Definition: KeyedObjectManager.cpp:12
Containers::find::operator()
bool operator()(const v_type &cmp) const
Definition: KeyedObjectManager.cpp:66
Containers::KeyedObjectManager::m_keyCtxt
long m_keyCtxt
Definition: KeyedObjectManager.h:52
Containers::OBJ_ERASED
Object was removed, but not deleted.
Definition: KeyedTraits.h:25
IOTest.end
def end
Definition: IOTest.py:112
Containers::array::decrement::m_min
long m_min
Definition: KeyedObjectManager.cpp:40
Containers::KeyedObjectManager::insert
long insert(ObjectContainerBase *b, ContainedObject *c, void *o, long *k)
Insert new object into container.
Definition: KeyedObjectManager.cpp:128
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Containers::find::find
find(const void *o)
Definition: KeyedObjectManager.cpp:64
Containers::array::decrement
Definition: KeyedObjectManager.cpp:39
std::move
T move(T... args)
std::pair
std::map::insert
T insert(T... args)
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition: ContainedObject.h:31
std::find_if
T find_if(T... args)
Containers::map::m
map_type m
Definition: KeyedObjectManager.cpp:24
std::vector< void * >
Containers::map
Definition: KeyedObjectManager.cpp:22
Containers::vector
Definition: KeyedObjectManager.cpp:50
Containers::cannotAssignObjectKey
GAUDI_API void cannotAssignObjectKey()
Function to be called when an object key cannot be assigned.
Definition: KeyedObjectManager.cpp:69
Containers::OBJ_CANNOT_INSERT
Cannot insert object into container.
Definition: KeyedTraits.h:27
Containers::KeyedObjectManager
KeyedObjectManager Class to manage keyed objects.
Definition: KeyedObjectManager.h:45
Containers::array::v
std::vector< void * > v
Direct access array.
Definition: KeyedObjectManager.cpp:38
ContainedObject::setParent
void setParent(ObjectContainerBase *value)
Update parent member.
Definition: ContainedObject.h:53
Containers::KeyedObjectManager::classID
static CLID classID()
Access CLID for this type of container.
GaudiUtils::HashMap< long, void * >
gaudirun.s
string s
Definition: gaudirun.py:316
Containers::KeyedObjectManager::setup
void setup(void *seq, void **rndm)
Setup of the Map and the parent object.
Definition: KeyedObjectManager.cpp:113
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
__A
Containers::array __A
Definition: KeyedObjectManager.cpp:301
ContainedObject.h
Containers::map::v
std::vector< void * > v
Definition: KeyedObjectManager.cpp:25
ContainedObject::parent
const ObjectContainerBase * parent() const
Access to parent object.
Definition: ContainedObject.h:51
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition: ObjectContainerBase.h:19
Containers::KeyedObjectManager::KeyedObjectManager
KeyedObjectManager()
Standard Constructor.
Definition: KeyedObjectManager.cpp:88
KeyedObjectManager.h
std::for_each
T for_each(T... args)
Containers::find
Definition: KeyedObjectManager.cpp:59
Containers::map::insert
bool insert(void *obj, long key)
Definition: KeyedObjectManager.cpp:26
Containers::KeyedObjectManager::insertDirect
long insertDirect(ObjectContainerBase *b, ContainedObject *c, void *o, long k)
Insert element into direct access map.
Definition: KeyedObjectManager.cpp:161
Containers::KeyedObjectManager::m_setup
union Containers::KeyedObjectManager::@2 m_setup