The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
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
>
15
#include <
GaudiKernel/KeyedTraits.h
>
16
#include <vector>
17
18
class
ObjectContainerBase
;
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>
47
class
GAUDI_API
KeyedObjectManager
{
48
private
:
49
typedef
std::vector<void*>
seq_type
;
51
seq_type
*
m_seq
;
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
:
66
KeyedObjectManager
();
67
KeyedObjectManager
(
KeyedObjectManager
&& other );
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
97
typedef
KeyedObjectManager<map>
Map
;
99
typedef
KeyedObjectManager<hashmap>
HashMap
;
101
typedef
KeyedObjectManager<vector>
Vector
;
103
typedef
KeyedObjectManager<array>
Array
;
104
}
// namespace Containers
ClassID.h
CLID
unsigned int CLID
Class ID definition.
Definition
ClassID.h:16
Kernel.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
KeyedTraits.h
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition
ContainedObject.h:37
Containers::KeyedObjectManager
KeyedObjectManager Class to manage keyed objects.
Definition
KeyedObjectManager.h:47
Containers::KeyedObjectManager< map >::m_keyCtxt
long m_keyCtxt
Definition
KeyedObjectManager.h:54
Containers::KeyedObjectManager::classID
static CLID classID()
Access CLID for this type of container.
Containers::KeyedObjectManager::insert
long insert(ObjectContainerBase *b, ContainedObject *c, void *o, long k)
Insert new object into container.
Definition
KeyedObjectManager.cpp:149
Containers::KeyedObjectManager::onDirty
void onDirty() const
Callback when the container becomes dirty.
Definition
KeyedObjectManager.cpp:133
Containers::KeyedObjectManager::erase
void * erase(long key, const void *obj)
Remove object from container (very inefficient if key is invalid).
Definition
KeyedObjectManager.cpp:200
Containers::KeyedObjectManager::setup
void setup(void *seq, void **rndm)
Setup of the Map and the parent object.
Definition
KeyedObjectManager.cpp:127
Containers::KeyedObjectManager::~KeyedObjectManager
virtual ~KeyedObjectManager()
Standard Destructor.
Definition
KeyedObjectManager.cpp:120
Containers::KeyedObjectManager< map >::buffer
char buffer[128]
Definition
KeyedObjectManager.h:57
Containers::KeyedObjectManager< map >::m_direct
long m_direct
Definition
KeyedObjectManager.h:53
Containers::KeyedObjectManager::erase
long erase(seq_type::iterator beg, seq_type::iterator end)
Remove object by sequential iterators.
Definition
KeyedObjectManager.cpp:267
Containers::KeyedObjectManager::clearDirect
void clearDirect()
Clear all direct access fields.
Definition
KeyedObjectManager.cpp:250
Containers::KeyedObjectManager::object
void * object(long key) const
Retrieve object identified by a key from the container.
Definition
KeyedObjectManager.cpp:222
Containers::KeyedObjectManager::KeyedObjectManager
KeyedObjectManager(KeyedObjectManager &&other)
Definition
KeyedObjectManager.cpp:106
Containers::KeyedObjectManager::KeyedObjectManager
KeyedObjectManager()
Standard Constructor.
Definition
KeyedObjectManager.cpp:97
Containers::KeyedObjectManager< map >::m_seq
seq_type * m_seq
Definition
KeyedObjectManager.h:51
Containers::KeyedObjectManager::reserve
void reserve(long size)
Reserve buffer space.
Definition
KeyedObjectManager.cpp:230
Containers::KeyedObjectManager::clear
void clear()
Clear content of the vector.
Definition
KeyedObjectManager.cpp:244
Containers::KeyedObjectManager< map >::s
map * s
Definition
KeyedObjectManager.h:58
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
Containers::KeyedObjectManager::insert
long insert(ObjectContainerBase *b, ContainedObject *c, void *o, long *k)
Insert new object into container.
Definition
KeyedObjectManager.cpp:142
Containers::KeyedObjectManager::insertDirect
long insertDirect(ObjectContainerBase *b, ContainedObject *c, void *o, long k)
Insert element into direct access map.
Definition
KeyedObjectManager.cpp:175
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition
ObjectContainerBase.h:26
Containers
Definition
KeyedObjectManager.h:21
Containers::Vector
KeyedObjectManager< vector > Vector
Forward declaration of specialized std::vector-like object manager.
Definition
KeyedObjectManager.h:101
Containers::MANIPULATOR
long(* MANIPULATOR)(void *)
Object manipulator type definition.
Definition
KeyedObjectManager.h:23
Containers::HashMap
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
Definition
KeyedObjectManager.h:99
Containers::Map
KeyedObjectManager< map > Map
Forward declaration of specialized std::map-like object manager.
Definition
KeyedObjectManager.h:97
Containers::Array
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
Definition
KeyedObjectManager.h:103
Containers::array
Definition
KeyedObjectManager.cpp:42
Containers::hashmap
Definition
KeyedObjectManager.cpp:20
Containers::map
Definition
KeyedObjectManager.cpp:31
Containers::vector
Definition
KeyedObjectManager.cpp:59
GaudiKernel
include
GaudiKernel
KeyedObjectManager.h
Generated on
for The Gaudi Framework by
1.17.0