| The Gaudi Framework v32r1 (f65d50dc)

KeyedObjectManager.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_KEYEDOBJECTMANAGER_H
2 #define GAUDIKERNEL_KEYEDOBJECTMANAGER_H
3
4 // Framework include files
5 #include "GaudiKernel/ClassID.h"
6 #include "GaudiKernel/Kernel.h"
7 #include "GaudiKernel/KeyedTraits.h"
8
9 // STL includes
10 #include <vector>
11
12 // Forward declarations
13 class ObjectContainerBase;
14 class ContainedObject;
15
18 namespace Containers {
19
21 typedef long ( *MANIPULATOR )( void* );
23 struct GAUDI_API hashmap;
25 struct GAUDI_API map;
27 struct GAUDI_API array;
29 struct GAUDI_API vector;
30
44 template <class SETUP>
45 class GAUDI_API KeyedObjectManager {
46 private:
47 typedef std::vector<void*> seq_type;
49 seq_type* m_seq;
51 mutable long m_direct;
52 mutable long m_keyCtxt;
53 union {
55 char buffer[128];
56 SETUP* s;
57 } m_setup;
58
60 void onDirty() const;
61
62 public:
64 KeyedObjectManager();
65 KeyedObjectManager( KeyedObjectManager&& other );
67 virtual ~KeyedObjectManager();
69 void clearDirect();
71 long insertDirect( ObjectContainerBase* b, ContainedObject* c, void* o, long k );
73 long isDirect() const { return m_direct; }
75 void* object( long key ) const;
77 long insert( ObjectContainerBase* b, ContainedObject* c, void* o, long* k );
79 long insert( ObjectContainerBase* b, ContainedObject* c, void* o, long k );
81 void* erase( long key, const void* obj );
83 long erase( seq_type::iterator beg, seq_type::iterator end );
85 void reserve( long size );
87 void clear();
89 void setup( void* seq, void** rndm );
91 static CLID classID();
92 };
93
95 typedef KeyedObjectManager<map> Map;
97 typedef KeyedObjectManager<hashmap> HashMap;
99 typedef KeyedObjectManager<vector> Vector;
101 typedef KeyedObjectManager<array> Array;
102 } // namespace Containers
103 #endif // GAUDIKERNEL_KEYEDOBJECTMANAGER_H
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:14
ClassID.h
Kernel.h
Containers::KeyedObjectManager::isDirect
long isDirect() const
Check if the container is dirty.
Definition: KeyedObjectManager.h:73
gaudirun.c
c
Definition: gaudirun.py:487
KeyedTraits.h
ManySmallAlgs.seq
seq
Definition: ManySmallAlgs.py:89
Gaudi::Functional::details::insert
constexpr struct Gaudi::Functional::details::insert_t insert
Containers::KeyedObjectManager::s
SETUP * s
Definition: KeyedObjectManager.h:56
Containers
Containers namespace.
Definition: KeyedObjectManager.h:18
Containers::array
Definition: KeyedObjectManager.cpp:33
Containers::hashmap
Definition: KeyedObjectManager.cpp:11
Containers::Vector
KeyedObjectManager< vector > Vector
Forward declaration of specialized std::vector-like object manager.
Definition: KeyedObjectManager.h:99
Containers::KeyedObjectManager::m_keyCtxt
long m_keyCtxt
Definition: KeyedObjectManager.h:52
IOTest.end
def end
Definition: IOTest.py:112
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Containers::KeyedObjectManager::seq_type
std::vector< void * > seq_type
Definition: KeyedObjectManager.h:47
Containers::MANIPULATOR
long(* MANIPULATOR)(void *)
Object manipulator type definition.
Definition: KeyedObjectManager.h:21
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition: ContainedObject.h:31
std::vector< void * >
Containers::map
Definition: KeyedObjectManager.cpp:22
Containers::vector
Definition: KeyedObjectManager.cpp:50
Containers::HashMap
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
Definition: KeyedObjectManager.h:97
Containers::KeyedObjectManager
KeyedObjectManager Class to manage keyed objects.
Definition: KeyedObjectManager.h:45
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition: ObjectContainerBase.h:19
Containers::Array
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
Definition: KeyedObjectManager.h:101
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
Containers::Map
KeyedObjectManager< map > Map
Forward declaration of specialized std::map-like object manager.
Definition: KeyedObjectManager.h:95
Containers::KeyedObjectManager::m_direct
long m_direct
Dirty flag.
Definition: KeyedObjectManager.h:51
Containers::KeyedObjectManager::m_seq
seq_type * m_seq
Container holding array like container.
Definition: KeyedObjectManager.h:49