ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthLinks
AthLinks
tools
ForwardIndexingPolicy.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3
/*
4
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5
*/
12
13
14
#ifndef ATHLINKS_FORWARDINDEXINGPOLICY_H
15
#define ATHLINKS_FORWARDINDEXINGPOLICY_H
16
17
18
#include "
AthLinks/exceptions.h
"
19
#include "
AthLinks/tools/findInContainer.h
"
20
#include "
AthenaKernel/tools/type_tools.h
"
21
#include "
AthenaKernel/ClassName.h
"
22
#include <cstddef>
23
#include <concepts>
24
#include <stdint.h>
25
26
27
namespace
SG
{
28
29
38
template
<
class
CONT,
class
VALUE_TYPE=
typename
CONT::value_type>
39
class
ForwardIndexingPolicy
40
{
41
private
:
42
typedef
VALUE_TYPE
value_type
;
43
44
45
public
:
47
typedef
typename
type_tools::Copy<value_type>::type
ElementType
;
48
typedef
typename
type_tools::Copy<value_type>::const_reference
ElementConstReference
;
49
typedef
typename
type_tools::Copy<value_type>::const_pointer
ElementConstPointer
;
50
52
typedef
size_t
index_type
;
53
55
typedef
uint32_t
stored_index_type
;
56
57
58
private
:
60
static
const
index_type
INVALID
=
static_cast<
index_type
>
(-1);
61
62
63
public
:
68
static
bool
isValid
(
stored_index_type
index
);
69
70
75
static
index_type
storedToExternal
(
stored_index_type
index
);
76
77
82
static
void
reset
(
stored_index_type
&
index
);
83
84
92
static
ElementType
lookup
(
index_type
index
,
const
CONT& data);
93
94
103
static
void
reverseLookup
(
const
CONT& data,
104
ElementConstReference
element,
105
index_type
&
index
);
106
};
107
108
109
}
// namespace SG
110
111
112
#include "
AthLinks/tools/ForwardIndexingPolicy.icc
"
113
114
115
#endif
// not ATHLINKS_FORWARDINDEXINGPOLICY_H
ClassName.h
An interface for getting the name of a class as a string.
exceptions.h
Exceptions that can be thrown from AthLinks.
ForwardIndexingPolicy.icc
SG::ForwardIndexingPolicy
Indexing policy for a vector-like container.
Definition
ForwardIndexingPolicy.h:40
SG::ForwardIndexingPolicy::lookup
static ElementType lookup(index_type index, const CONT &data)
Retrieve from a container the element corresponding to an index.
SG::ForwardIndexingPolicy< STORABLE >::stored_index_type
uint32_t stored_index_type
Definition
ForwardIndexingPolicy.h:55
SG::ForwardIndexingPolicy< STORABLE >::value_type
typename STORABLE::value_type value_type
Definition
ForwardIndexingPolicy.h:42
SG::ForwardIndexingPolicy< STORABLE >::index_type
size_t index_type
Definition
ForwardIndexingPolicy.h:52
SG::ForwardIndexingPolicy::reverseLookup
static void reverseLookup(const CONT &data, ElementConstReference element, index_type &index)
Find the index of the (first) instance of ELEMENT in DATA.
SG::ForwardIndexingPolicy< STORABLE >::ElementType
type_tools::Copy< value_type >::type ElementType
Definition
ForwardIndexingPolicy.h:47
SG::ForwardIndexingPolicy< STORABLE >::INVALID
static const index_type INVALID
Definition
ForwardIndexingPolicy.h:60
SG::ForwardIndexingPolicy< STORABLE >::ElementConstReference
type_tools::Copy< value_type >::const_reference ElementConstReference
Definition
ForwardIndexingPolicy.h:48
SG::ForwardIndexingPolicy::storedToExternal
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
SG::ForwardIndexingPolicy< STORABLE >::ElementConstPointer
type_tools::Copy< value_type >::const_pointer ElementConstPointer
Definition
ForwardIndexingPolicy.h:49
SG::ForwardIndexingPolicy::reset
static void reset(stored_index_type &index)
Make an index invalid.
SG::ForwardIndexingPolicy::isValid
static bool isValid(stored_index_type index)
Test to see if an index is valid.
findInContainer.h
Define a specializable method for finding the index of an object within a container.
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
index
Definition
index.py:1
type_tools::Copy::type
T type
Definition
type_tools.h:52
type_tools::Copy::const_reference
const T & const_reference
Definition
type_tools.h:53
type_tools::Copy::const_pointer
const T * const_pointer
Definition
type_tools.h:54
type_tools.h
Generated on
for ATLAS Offline Software by
1.17.0