The Gaudi Framework  master (d98a2936)
KeyedObjectManager.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 #pragma once
12 
13 #include <GaudiKernel/ClassID.h>
14 #include <GaudiKernel/Kernel.h>
16 #include <vector>
17 
19 class ContainedObject;
20 
21 namespace Containers {
23  typedef long ( *MANIPULATOR )( void* );
25  struct GAUDI_API hashmap;
27  struct GAUDI_API map;
29  struct GAUDI_API array;
31  struct GAUDI_API vector;
32 
46  template <class SETUP>
48  private:
49  typedef std::vector<void*> seq_type;
53  mutable long m_direct;
54  mutable long m_keyCtxt;
55  union {
57  char buffer[128];
58  SETUP* s;
59  } m_setup;
60 
62  void onDirty() const;
63 
64  public:
69  virtual ~KeyedObjectManager();
71  void clearDirect();
73  long insertDirect( ObjectContainerBase* b, ContainedObject* c, void* o, long k );
75  long isDirect() const { return m_direct; }
77  void* object( long key ) const;
79  long insert( ObjectContainerBase* b, ContainedObject* c, void* o, long* k );
81  long insert( ObjectContainerBase* b, ContainedObject* c, void* o, long k );
83  void* erase( long key, const void* obj );
85  long erase( seq_type::iterator beg, seq_type::iterator end );
87  void reserve( long size );
89  void clear();
91  void setup( void* seq, void** rndm );
93  static CLID classID();
94  };
95 
104 } // namespace Containers
Containers::KeyedObjectManager
KeyedObjectManager Class to manage keyed objects.
Definition: KeyedObjectManager.h:47
Containers::Array
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
Definition: KeyedObjectManager.h:103
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:23
Containers::KeyedObjectManager::s
SETUP * s
Definition: KeyedObjectManager.h:58
ClassID.h
Containers::KeyedObjectManager::m_direct
long m_direct
Dirty flag.
Definition: KeyedObjectManager.h:53
Containers
Definition: KeyedObjectManager.h:21
gaudirun.c
c
Definition: gaudirun.py:525
Containers::KeyedObjectManager::m_keyCtxt
long m_keyCtxt
Definition: KeyedObjectManager.h:54
Containers::MANIPULATOR
long(* MANIPULATOR)(void *)
Object manipulator type definition.
Definition: KeyedObjectManager.h:23
Containers::array
Definition: KeyedObjectManager.cpp:42
KeyedTraits.h
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:16
ObjectContainerBase
Definition: ObjectContainerBase.h:26
Containers::hashmap
Definition: KeyedObjectManager.cpp:20
Kernel.h
Containers::map
Definition: KeyedObjectManager.cpp:31
Containers::vector
Definition: KeyedObjectManager.cpp:59
Containers::KeyedObjectManager::isDirect
long isDirect() const
Check if the container is dirty.
Definition: KeyedObjectManager.h:75
Containers::KeyedObjectManager::seq_type
std::vector< void * > seq_type
Definition: KeyedObjectManager.h:49
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:99
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:97
Containers::Vector
KeyedObjectManager< vector > Vector
Forward declaration of specialized std::vector-like object manager.
Definition: KeyedObjectManager.h:101
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
Containers::KeyedObjectManager::m_seq
seq_type * m_seq
Container holding array like container.
Definition: KeyedObjectManager.h:51
ContainedObject
Definition: ContainedObject.h:37