ATLAS Offline Software
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$
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 <boost/concept_check.hpp>
28 #include <set>
29 #include <algorithm>
30 #include <cassert>
31 
32 
33 namespace SG {
34 
35 
45 template <class SET>
47 {
48 private:
49  //compiler checks that SET is an stl simple associative container
50  BOOST_CONCEPT_ASSERT((boost::SimpleAssociativeContainerConcept<SET>));
51 
52  typedef typename SET::reference reference;
53  typedef typename SET::iterator iterator;
54 
55 public:
57  typedef typename SET::value_type ElementType;
58  typedef typename SET::const_reference ElementConstReference;
59  typedef typename SET::const_pointer ElementConstPointer;
60 
62  typedef typename SET::key_type index_type;
63 
66 
67 
72  static bool isValid (const stored_index_type& index);
73 
74 
80 
81 
86  static void reset (stored_index_type& index);
87 
88 
97  static
99 
100 
109  static void
111  ElementConstReference element,
112  index_type& same);
113 };
114 
115 } // namespace SG
116 
117 
118 
120 template <typename KEY>
121 struct DefaultIndexingPolicy <std::set<KEY> > {
123 };
124 
125 
127 
128 
129 #endif // not ATHLINKS_SETINDEXINGPOLICY_H
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
DefaultIndexingPolicy< std::set< KEY > >::type
SG::SetIndexingPolicy< std::set< KEY > > type
Definition: SetIndexingPolicy.h:122
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SG::SetIndexingPolicy
Indexing policy for a set-like container.
Definition: SetIndexingPolicy.h:47
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
SG::SetIndexingPolicy::reference
SET::reference reference
Definition: SetIndexingPolicy.h:52
SG::SetIndexingPolicy::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::SimpleAssociativeContainerConcept< SET >))
index
Definition: index.py:1
SG::SetIndexingPolicy::storedToExternal
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
SG::SetIndexingPolicy::iterator
SET::iterator iterator
Definition: SetIndexingPolicy.h:53
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.
python.TrigEgammaFastCaloHypoTool.same
def same(val, tool)
Definition: TrigEgammaFastCaloHypoTool.py:12
SG::SetIndexingPolicy::ElementConstReference
SET::const_reference ElementConstReference
Definition: SetIndexingPolicy.h:58
DefaultIndexingPolicy.h
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:62
SG::SetIndexingPolicy::isValid
static bool isValid(const stored_index_type &index)
Test to see if an index is valid.
SG::SetIndexingPolicy::ElementConstPointer
SET::const_pointer ElementConstPointer
Definition: SetIndexingPolicy.h:59
SG::SetIndexingPolicy::lookup
static ElementType lookup(const stored_index_type &index, const SET &data)
Retrieve from a container the element corresponding to an index.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
SG::IndexHolder
Store an ElementLink index for non-vector containers.
Definition: IndexHolder.h:36
DefaultIndexingPolicy
Definition: DefaultIndexingPolicy.h:23
dq_make_web_display.reference
reference
Definition: dq_make_web_display.py:44
IndexHolder.h
Store an ElementLink index for non-vector containers.
SetIndexingPolicy.icc
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:65
SG::SetIndexingPolicy::reset
static void reset(stored_index_type &index)
Make an index invalid.
SG::SetIndexingPolicy::ElementType
SET::value_type ElementType
The type we get when we dereference a link, and derived types.
Definition: SetIndexingPolicy.h:57
type_tools.h
SET
#define SET(n)
Definition: MD5.cxx:147