ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 */
14 #ifndef ATHLINKS_FORWARDINDEXINGPOLICY_H
15 #define ATHLINKS_FORWARDINDEXINGPOLICY_H
16 
17 
18 #include "AthLinks/exceptions.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>
40 {
41 private:
42  typedef VALUE_TYPE value_type;
43 
44 
45 public:
50 
52  typedef size_t index_type;
53 
56 
57 
58 private:
60  static const index_type INVALID = static_cast<index_type> (-1);
61 
62 
63 public:
69 
70 
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 
113 
114 
115 #endif // not ATHLINKS_FORWARDINDEXINGPOLICY_H
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
index
Definition: index.py:1
SG::ForwardIndexingPolicy::lookup
static ElementType lookup(index_type index, const CONT &data)
Retrieve from a container the element corresponding to an index.
SG::ForwardIndexingPolicy::storedToExternal
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
SG::ForwardIndexingPolicy::stored_index_type
uint32_t stored_index_type
The type of an index, as stored internally within a link.
Definition: ForwardIndexingPolicy.h:55
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.
ForwardIndexingPolicy.icc
SG::ForwardIndexingPolicy::index_type
size_t index_type
The type of an index, as provided to or returned from a link.
Definition: ForwardIndexingPolicy.h:52
ClassName.h
An interface for getting the name of a class as a string.
SG::ForwardIndexingPolicy::value_type
VALUE_TYPE value_type
Definition: ForwardIndexingPolicy.h:42
SG::ForwardIndexingPolicy::INVALID
static const index_type INVALID
Value to mark an invalid index.
Definition: ForwardIndexingPolicy.h:60
SG::ForwardIndexingPolicy::ElementType
type_tools::Copy< value_type >::type ElementType
The type we get when we dereference a link, and derived types.
Definition: ForwardIndexingPolicy.h:47
SG::ForwardIndexingPolicy::ElementConstReference
type_tools::Copy< value_type >::const_reference ElementConstReference
Definition: ForwardIndexingPolicy.h:48
findInContainer.h
Define a specializable method for finding the index of an object within a container.
SG::ForwardIndexingPolicy
Indexing policy for a vector-like container.
Definition: ForwardIndexingPolicy.h:40
SG::ForwardIndexingPolicy::ElementConstPointer
type_tools::Copy< value_type >::const_pointer ElementConstPointer
Definition: ForwardIndexingPolicy.h:49
value_type
Definition: EDM_MasterSearch.h:11
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.
type_tools.h