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"
9 
10 // STL includes
11 #include <vector>
12 
13 // Forward declarations
15 class ContainedObject;
16 
19 namespace Containers {
20 
22  typedef long (*MANIPULATOR)(void*);
26  struct GAUDI_API map;
28  struct GAUDI_API array;
30  struct GAUDI_API vector;
31 
45  template <class SETUP>
47  private:
48  typedef std::vector<void*> seq_type;
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:
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 
102 }
103 #endif // GAUDIKERNEL_KEYEDOBJECTMANAGER_H
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
tuple c
Definition: gaudirun.py:341
KeyedObjectManager< vector > Vector
Forward declaration of specialized std::vector-like object manager.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
std::vector< void * > seq_type
tuple end
Definition: IOTest.py:101
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
long(* MANIPULATOR)(void *)
Object manipulator type definition.
KeyedObjectManager Class to manage keyed objects.
long isDirect() const
Check if the container is dirty.
ObjectContainerBase is the base class for Gaudi container classes.
#define GAUDI_API
Definition: Kernel.h:108
KeyedObjectManager< map > Map
Forward declaration of specialized std::map-like object manager.
seq_type * m_seq
Container holding array like container.