ATLAS Offline Software
Loading...
Searching...
No Matches
MapIndexingPolicy.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-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id$
14
15
16#ifndef ATHLINKS_MAPINDEXINGPOLICY_H
17#define ATHLINKS_MAPINDEXINGPOLICY_H
18
19
20
23#include "AthLinks/exceptions.h"
26#include "GaudiKernel/MsgStream.h"
27#include "CxxUtils/concepts.h"
28#include <concepts>
29#include <utility>
30#include <type_traits>
31#include <map>
32#include <algorithm>
33#include <cassert>
34
35
36namespace SG {
37
38
49
50template <CxxUtils::detail::PairAssociativeContainer MAP>
52{
53private:
54
55 typedef typename MAP::mapped_type mapped_type;
56 typedef typename MAP::const_iterator const_iterator;
57
58
59public:
64
66 typedef typename MAP::key_type index_type;
67
70
71
76 static bool isValid (const stored_index_type& index) ;
77
78
84
85
91
92
101 static
103
104
113 static void
114 reverseLookup(const MAP& data,
115 ElementConstReference element,
117};
118
119
120} // namespace SG
121
122
124template <typename KEY, typename ELEM>
128
129
131
132
133#endif // not ATHLINKS_MAPINDEXINGPOLICY_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Store an ElementLink index for non-vector containers.
Store an ElementLink index for non-vector containers.
Definition IndexHolder.h:33
Indexing policy for a map-like container.
MAP::key_type index_type
The type of an index, as provided to or returned from a link.
SG::IndexHolder< index_type > stored_index_type
The type of an index, as stored internally within a link.
type_tools::Copy< mapped_type >::type ElementType
The type we get when we dereference a link, and derived types.
MAP::const_iterator const_iterator
type_tools::Copy< mapped_type >::const_reference ElementConstReference
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
static ElementType lookup(const stored_index_type &index, const MAP &data)
Retrieve from a container the element corresponding to an index.
static void reverseLookup(const MAP &data, ElementConstReference element, index_type &index)
Find the index of the (first) instance of ELEMENT in DATA.
static bool isValid(const stored_index_type &index)
Test to see if an index is valid.
static void reset(stored_index_type &index)
Make an index invalid.
MAP::mapped_type mapped_type
type_tools::Copy< mapped_type >::const_pointer ElementConstPointer
STL class.
A couple standard-library related concepts.
singleton-like access to IMessageSvc via open function and helper
Forward declaration.
Definition index.py:1
STL namespace.
SG::MapIndexingPolicy< std::map< KEY, ELEM > > type
const T & const_reference
Definition type_tools.h:53
const T * const_pointer
Definition type_tools.h:54