| The Gaudi Framework v29r0 (ff2e7097)

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

- File List
- File Members

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