ATLAS Offline Software
Loading...
Searching...
No Matches
SetIndexingPolicy.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_SETINDEXINGPOLICY_H
17#define ATHLINKS_SETINDEXINGPOLICY_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 <set>
32#include <algorithm>
33#include <cassert>
34
35
36namespace SG {
37
38
48
49template <class SET>
50requires CxxUtils::detail::SimpleAssociativeContainer<SET>
52{
53private:
54
55 typedef typename SET::reference reference;
56 typedef typename SET::iterator iterator;
57
58public:
60 typedef typename SET::value_type ElementType;
61 typedef typename SET::const_reference ElementConstReference;
62 typedef typename SET::const_pointer ElementConstPointer;
63
65 typedef typename SET::key_type index_type;
66
69
70
75 static bool isValid (const stored_index_type& index);
76
77
83
84
90
91
100 static
102
103
112 static void
114 ElementConstReference element,
115 index_type& same);
116};
117
118} // namespace SG
119
120
121
123template <typename KEY>
127
128
130
131
132#endif // not ATHLINKS_SETINDEXINGPOLICY_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Store an ElementLink index for non-vector containers.
#define SET(n)
Definition MD5.cxx:147
Store an ElementLink index for non-vector containers.
Definition IndexHolder.h:33
Indexing policy for a set-like container.
SET::const_reference ElementConstReference
static ElementType lookup(const stored_index_type &index, const SET &data)
Retrieve from a container the element corresponding to an index.
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
static void reverseLookup(const SET &data, ElementConstReference element, index_type &same)
Find the index of the (first) instance of ELEMENT in DATA.
SET::value_type ElementType
The type we get when we dereference a link, and derived types.
static bool isValid(const stored_index_type &index)
Test to see if an index is valid.
SET::const_pointer ElementConstPointer
SET::key_type index_type
The type of an index, as provided to or returned from a link.
static void reset(stored_index_type &index)
Make an index invalid.
SG::IndexHolder< index_type > stored_index_type
The type of an index, as stored internally within a link.
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::SetIndexingPolicy< std::set< KEY > > type