ATLAS Offline Software
Loading...
Searching...
No Matches
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"
22#include <cstddef>
23#include <concepts>
24#include <stdint.h>
25
26
27namespace SG {
28
29
38template <class CONT, class VALUE_TYPE=typename CONT::value_type>
40{
41private:
42 typedef VALUE_TYPE value_type;
43
44
45public:
50
52 typedef size_t index_type;
53
55 typedef uint32_t stored_index_type;
56
57
58private:
60 static const index_type INVALID = static_cast<index_type> (-1);
61
62
63public:
69
70
76
77
83
84
92 static ElementType lookup (index_type index, const CONT& data);
93
94
103 static void reverseLookup(const CONT& data,
104 ElementConstReference element,
106};
107
108
109} // namespace SG
110
111
113
114
115#endif // not ATHLINKS_FORWARDINDEXINGPOLICY_H
An interface for getting the name of a class as a string.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Indexing policy for a vector-like container.
static ElementType lookup(index_type index, const CONT &data)
Retrieve from a container the element corresponding to an index.
typename STORABLE::value_type value_type
static void reverseLookup(const CONT &data, ElementConstReference element, index_type &index)
Find the index of the (first) instance of ELEMENT in DATA.
type_tools::Copy< value_type >::type ElementType
type_tools::Copy< value_type >::const_reference ElementConstReference
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
type_tools::Copy< value_type >::const_pointer ElementConstPointer
static void reset(stored_index_type &index)
Make an index invalid.
static bool isValid(stored_index_type index)
Test to see if an index is valid.
Define a specializable method for finding the index of an object within a container.
Forward declaration.
Definition index.py:1
const T & const_reference
Definition type_tools.h:53
const T * const_pointer
Definition type_tools.h:54