ATLAS Offline Software
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-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef ATHLINKS_FORWARDINDEXINGPOLICY_H
17 #define ATHLINKS_FORWARDINDEXINGPOLICY_H
18 
19 
20 #include "AthLinks/exceptions.h"
23 #include "AthenaKernel/ClassName.h"
24 #include <boost/concept_check.hpp>
25 #include <cstddef>
26 #include <stdint.h>
27 
28 
29 namespace SG {
30 
31 
40 template <class CONT, class VALUE_TYPE=typename CONT::value_type>
42 {
43 private:
44  typedef VALUE_TYPE value_type;
45 
46 
47 public:
52 
54  typedef size_t index_type;
55 
58 
59 
60 private:
62  static const index_type INVALID = static_cast<index_type> (-1);
63 
64 
65 public:
71 
72 
78 
79 
84  static void reset (stored_index_type& index);
85 
86 
94  static ElementType lookup (index_type index, const CONT& data);
95 
96 
105  static void reverseLookup(const CONT& data,
106  ElementConstReference element,
107  index_type& index);
108 };
109 
110 
111 } // namespace SG
112 
113 
115 
116 
117 #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:57
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:54
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:44
SG::ForwardIndexingPolicy::INVALID
static const index_type INVALID
Value to mark an invalid index.
Definition: ForwardIndexingPolicy.h:62
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:49
SG::ForwardIndexingPolicy::ElementConstReference
type_tools::Copy< value_type >::const_reference ElementConstReference
Definition: ForwardIndexingPolicy.h:50
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:42
SG::ForwardIndexingPolicy::ElementConstPointer
type_tools::Copy< value_type >::const_pointer ElementConstPointer
Definition: ForwardIndexingPolicy.h:51
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