ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthLinks
AthLinks
tools
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
21
#include "
AthLinks/tools/DefaultIndexingPolicy.h
"
22
#include "
AthLinks/tools/IndexHolder.h
"
23
#include "
AthLinks/exceptions.h
"
24
#include "
AthenaKernel/tools/type_tools.h
"
25
#include "
AthenaKernel/getMessageSvc.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
36
namespace
SG
{
37
38
48
49
template
<
class
SET>
50
requires
CxxUtils::detail::SimpleAssociativeContainer<SET>
51
class
SetIndexingPolicy
52
{
53
private
:
54
55
typedef
typename
SET::reference
reference
;
56
typedef
typename
SET::iterator
iterator
;
57
58
public
:
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
68
typedef
SG::IndexHolder<index_type>
stored_index_type
;
69
70
75
static
bool
isValid
(
const
stored_index_type
&
index
);
76
77
82
static
index_type
storedToExternal
(
stored_index_type
index
);
83
84
89
static
void
reset
(
stored_index_type
&
index
);
90
91
100
static
101
ElementType
lookup
(
const
stored_index_type
&
index
,
const
SET
& data);
102
103
112
static
void
113
reverseLookup
(
const
SET
& data,
114
ElementConstReference
element,
115
index_type
& same);
116
};
117
118
}
// namespace SG
119
120
121
123
template
<
typename
KEY>
124
struct
DefaultIndexingPolicy
<
std
::
set
<KEY> > {
125
typedef
SG::SetIndexingPolicy<std::set<KEY>
>
type
;
126
};
127
128
129
#include "
AthLinks/tools/SetIndexingPolicy.icc
"
130
131
132
#endif
// not ATHLINKS_SETINDEXINGPOLICY_H
exceptions.h
Exceptions that can be thrown from AthLinks.
DefaultIndexingPolicy.h
IndexHolder.h
Store an ElementLink index for non-vector containers.
SET
#define SET(n)
Definition
MD5.cxx:147
SetIndexingPolicy.icc
SG::IndexHolder
Store an ElementLink index for non-vector containers.
Definition
IndexHolder.h:33
SG::SetIndexingPolicy
Indexing policy for a set-like container.
Definition
SetIndexingPolicy.h:52
SG::SetIndexingPolicy::ElementConstReference
SET::const_reference ElementConstReference
Definition
SetIndexingPolicy.h:61
SG::SetIndexingPolicy::lookup
static ElementType lookup(const stored_index_type &index, const SET &data)
Retrieve from a container the element corresponding to an index.
SG::SetIndexingPolicy::storedToExternal
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
SG::SetIndexingPolicy::reverseLookup
static void reverseLookup(const SET &data, ElementConstReference element, index_type &same)
Find the index of the (first) instance of ELEMENT in DATA.
SG::SetIndexingPolicy::ElementType
SET::value_type ElementType
The type we get when we dereference a link, and derived types.
Definition
SetIndexingPolicy.h:60
SG::SetIndexingPolicy::isValid
static bool isValid(const stored_index_type &index)
Test to see if an index is valid.
SG::SetIndexingPolicy::reference
SET::reference reference
Definition
SetIndexingPolicy.h:55
SG::SetIndexingPolicy::iterator
SET::iterator iterator
Definition
SetIndexingPolicy.h:56
SG::SetIndexingPolicy::ElementConstPointer
SET::const_pointer ElementConstPointer
Definition
SetIndexingPolicy.h:62
SG::SetIndexingPolicy::index_type
SET::key_type index_type
The type of an index, as provided to or returned from a link.
Definition
SetIndexingPolicy.h:65
SG::SetIndexingPolicy::reset
static void reset(stored_index_type &index)
Make an index invalid.
SG::SetIndexingPolicy::stored_index_type
SG::IndexHolder< index_type > stored_index_type
The type of an index, as stored internally within a link.
Definition
SetIndexingPolicy.h:68
set
STL class.
concepts.h
A couple standard-library related concepts.
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
index
Definition
index.py:1
std
STL namespace.
DefaultIndexingPolicy< std::set< KEY > >::type
SG::SetIndexingPolicy< std::set< KEY > > type
Definition
SetIndexingPolicy.h:125
DefaultIndexingPolicy
Definition
DefaultIndexingPolicy.h:23
type_tools.h
Generated on
for ATLAS Offline Software by
1.17.0