| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- 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
KeyedObjectManager.h
Go to the documentation of this file.
1 // $Id $
2 #ifndef GAUDIKERNEL_KEYEDOBJECTMANAGER_H
3 #define GAUDIKERNEL_KEYEDOBJECTMANAGER_H
4
5 // Framework include files
6 #include "GaudiKernel/Kernel.h"
7 #include "GaudiKernel/ClassID.h"
8 #include "GaudiKernel/KeyedTraits.h"
9
10 // STL includes
11 #include <vector>
12
13 // Forward declarations
14 class ObjectContainerBase;
15 class ContainedObject;
16
19 namespace Containers {
20
22 typedef long (*MANIPULATOR)(void*);
24 struct GAUDI_API hashmap;
26 struct GAUDI_API map;
28 struct GAUDI_API array;
30 struct GAUDI_API vector;
31
45 template <class SETUP>
46 class GAUDI_API KeyedObjectManager {
47 private:
48 typedef std::vector<void*> seq_type;
50 seq_type* m_seq;
52 mutable long m_direct;
53 mutable long m_keyCtxt;
54 union {
56 char buffer[128];
57 SETUP* s;
58 } m_setup;
59
61 void onDirty() const;
62
63 public:
65 KeyedObjectManager();
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 }
103 #endif // GAUDIKERNEL_KEYEDOBJECTMANAGER_H