ATLAS Offline Software
IdentContIndexingPolicy.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 #ifndef ATHLINKS_TOOLS_IDENTCONTINDEXINGPOLICY_H
15 #define ATHLINKS_TOOLS_IDENTCONTINDEXINGPOLICY_H
16 
18 #include "AthLinks/exceptions.h"
21 #include "GaudiKernel/MsgStream.h"
22 #include <boost/concept_check.hpp>
23 #include <cassert>
24 #include <stdexcept>
25 
26 
27 namespace SG {
28 
29 
43 template <class CONT>
45 {
46 private:
47  typedef typename CONT::IDENTIFIABLE coll_type;
48  typedef typename coll_type::value_type obj_type;
49 
50 
51 public:
56 
58  typedef unsigned int index_type;
59 
62 
63 
69 
70 
76 
77 
82  static void reset (stored_index_type& index);
83 
84 
93  static
95 
96 
105  static void
106  reverseLookup(const CONT& data,
107  ElementConstReference element,
108  index_type& index);
109 };
110 
111 
112 } // namespace SG
113 
114 
116 
117 
118 #endif // ATHLINKS_TOOLS_IDENTCONTINDEXINGPOLICY_H
SG::IdentContIndexingPolicy::isValid
static bool isValid(stored_index_type index)
Test to see if an index is valid.
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SG::IdentContIndexingPolicy::coll_type
CONT::IDENTIFIABLE coll_type
Definition: IdentContIndexingPolicy.h:47
SG::IdentContIndexingPolicy::reset
static void reset(stored_index_type &index)
Make an index invalid.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
index
Definition: index.py:1
SG::IdentContIndexingPolicy::lookup
static ElementType lookup(index_type index, const CONT &data)
Retrieve from a container the element corresponding to an index.
SG::IdentContIndexingPolicy::index_type
unsigned int index_type
The type of an index, as provided to or returned from a link.
Definition: IdentContIndexingPolicy.h:58
SG::IdentContIndexingPolicy::ElementConstPointer
type_tools::Copy< obj_type >::const_pointer ElementConstPointer
Definition: IdentContIndexingPolicy.h:55
IdentContIndexingPolicy.icc
SG::IdentContIndexingPolicy::ElementConstReference
type_tools::Copy< obj_type >::const_reference ElementConstReference
Definition: IdentContIndexingPolicy.h:54
SG::IdentContIndexingPolicy::stored_index_type
index_type stored_index_type
The type of an index, as stored internally within a link.
Definition: IdentContIndexingPolicy.h:61
SG::IdentContIndexingPolicy::storedToExternal
static index_type storedToExternal(stored_index_type index)
Convert from stored to external index types.
IdentContIndex.h
SG::IdentContIndexingPolicy
Indexing policy for an IdentifiableContainer.
Definition: IdentContIndexingPolicy.h:45
SG::IdentContIndexingPolicy::ElementType
type_tools::Copy< obj_type >::type ElementType
The type we get when we dereference a link, and derived types.
Definition: IdentContIndexingPolicy.h:53
SG::IdentContIndexingPolicy::obj_type
coll_type::value_type obj_type
Definition: IdentContIndexingPolicy.h:48
SG::IdentContIndexingPolicy::reverseLookup
static void reverseLookup(const CONT &data, ElementConstReference element, index_type &index)
Find the index of the (first) instance of ELEMENT in DATA.
value_type
Definition: EDM_MasterSearch.h:11
type_tools.h