The Gaudi Framework  master (37c0b60a)
KeyedObjectManager.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_KEYEDOBJECTMANAGER_H
12 #define GAUDIKERNEL_KEYEDOBJECTMANAGER_H
13 
14 // Framework include files
15 #include <GaudiKernel/ClassID.h>
16 #include <GaudiKernel/Kernel.h>
18 
19 // STL includes
20 #include <vector>
21 
22 // Forward declarations
24 class ContainedObject;
25 
28 namespace Containers {
29 
31  typedef long ( *MANIPULATOR )( void* );
33  struct GAUDI_API hashmap;
35  struct GAUDI_API map;
37  struct GAUDI_API array;
39  struct GAUDI_API vector;
40 
54  template <class SETUP>
56  private:
61  mutable long m_direct;
62  mutable long m_keyCtxt;
63  union {
65  char buffer[128];
66  SETUP* s;
67  } m_setup;
68 
70  void onDirty() const;
71 
72  public:
77  virtual ~KeyedObjectManager();
79  void clearDirect();
81  long insertDirect( ObjectContainerBase* b, ContainedObject* c, void* o, long k );
83  long isDirect() const { return m_direct; }
85  void* object( long key ) const;
87  long insert( ObjectContainerBase* b, ContainedObject* c, void* o, long* k );
89  long insert( ObjectContainerBase* b, ContainedObject* c, void* o, long k );
91  void* erase( long key, const void* obj );
93  long erase( seq_type::iterator beg, seq_type::iterator end );
95  void reserve( long size );
97  void clear();
99  void setup( void* seq, void** rndm );
101  static CLID classID();
102  };
103 
112 } // namespace Containers
113 #endif // GAUDIKERNEL_KEYEDOBJECTMANAGER_H
Containers::KeyedObjectManager
KeyedObjectManager Class to manage keyed objects.
Definition: KeyedObjectManager.h:55
Containers::Array
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
Definition: KeyedObjectManager.h:111
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:23
Containers::KeyedObjectManager::s
SETUP * s
Definition: KeyedObjectManager.h:66
std::vector< void * >
ClassID.h
Containers::KeyedObjectManager::m_direct
long m_direct
Dirty flag.
Definition: KeyedObjectManager.h:61
Containers
Containers namespace.
Definition: KeyedObjectManager.h:28
gaudirun.c
c
Definition: gaudirun.py:525
Containers::KeyedObjectManager::m_keyCtxt
long m_keyCtxt
Definition: KeyedObjectManager.h:62
Containers::MANIPULATOR
long(* MANIPULATOR)(void *)
Object manipulator type definition.
Definition: KeyedObjectManager.h:31
Containers::array
Definition: KeyedObjectManager.cpp:43
KeyedTraits.h
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
ObjectContainerBase
Definition: ObjectContainerBase.h:29
Containers::hashmap
Definition: KeyedObjectManager.cpp:21
Kernel.h
Containers::map
Definition: KeyedObjectManager.cpp:32
Containers::vector
Definition: KeyedObjectManager.cpp:60
Containers::KeyedObjectManager::isDirect
long isDirect() const
Check if the container is dirty.
Definition: KeyedObjectManager.h:83
Containers::KeyedObjectManager::seq_type
std::vector< void * > seq_type
Definition: KeyedObjectManager.h:57
IOTest.end
end
Definition: IOTest.py:125
ManySmallAlgs.seq
seq
Definition: ManySmallAlgs.py:102
Containers::HashMap
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
Definition: KeyedObjectManager.h:107
Gaudi::Functional::details::insert
constexpr struct Gaudi::Functional::details::insert_t insert
ProduceConsume.key
key
Definition: ProduceConsume.py:84
Containers::KeyedObjectManager::classID
static CLID classID()
Access CLID for this type of container.
Containers::Map
KeyedObjectManager< map > Map
Forward declaration of specialized std::map-like object manager.
Definition: KeyedObjectManager.h:105
Containers::Vector
KeyedObjectManager< vector > Vector
Forward declaration of specialized std::vector-like object manager.
Definition: KeyedObjectManager.h:109
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
Containers::KeyedObjectManager::m_seq
seq_type * m_seq
Container holding array like container.
Definition: KeyedObjectManager.h:59
ContainedObject
Definition: ContainedObject.h:41