![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <IndexMap.h>
|
| IndexMap (INamedInterface *parent, const std::string &targetLabel, ToolHandle< ICollectionGetterRegistryTool > ®istry, const bool &allowMissing) |
| Constructor: for a single target. More...
|
|
| IndexMap (INamedInterface *parent, const std::string &targetLabel, const std::vector< std::string > &targetLabels, ToolHandle< ICollectionGetterRegistryTool > ®istry, const bool &allowMissing) |
| Constructor: for multiple targets. More...
|
|
| IndexMap (INamedInterface *parent, ToolHandleArray< ICollectionGetterTool > &getters, const bool &allowMissing) |
| Constructor: passing the list of getters directly. More...
|
|
StatusCode | configureD3PD () |
| Configure during initialization: type-check. More...
|
|
StatusCode | configureD3PD (const std::type_info &ti) |
| Configure during initialization: type-check. More...
|
|
ICollectionGetterTool * | target () |
| Return the getter defining the first collection within which to index. More...
|
|
ICollectionGetterTool * | target (unsigned int i) |
| Return the getter defining the i'th collection within which to index. More...
|
|
int | ntargets () |
| Return the number of valid targets. More...
|
|
virtual void | handle (const Incident &inc) |
| Incident handler. More...
|
|
StatusCode | reset () |
| Call before asking for an index. Rebuilds cache if needed. More...
|
|
int | findIndex (const void *p) |
| Find the index corresponding to an element. More...
|
|
int | findIndex (const void *p, unsigned int i) |
| Find the index corresponding to an element within a specific container. More...
|
|
std::pair< int, int > | findIndexPair (const void *p) |
| Find the (index,container) pair corresponding to an element. More...
|
|
bool | valid () const |
| Return the valid flag. More...
|
|
std::string | formatLabels () const |
| Return list of all configured targets as a comma-separated string. More...
|
|
virtual unsigned long | addRef () |
| Dummies needed to satisfy IInterface requirements. More...
|
|
virtual unsigned long | release () |
|
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
|
|
typedef std::unordered_multimap< const void *, std::pair< int, int > > | map_t |
| The pointer -> (index,target) map. More...
|
|
Definition at line 42 of file IndexMap.h.
◆ map_t
The pointer -> (index,target) map.
Definition at line 199 of file IndexMap.h.
◆ IndexMap() [1/3]
Constructor: for a single target.
- Parameters
-
Definition at line 31 of file IndexMap.cxx.
◆ IndexMap() [2/3]
Constructor: for multiple targets.
Constructor.
- Parameters
-
parent | The parent tool. |
targetLabel | Property for the label of the getter defining the target collection. If non-empty, this will be considered to be at the start of targetLabels. |
targetLabels | Property for the label of the getter defining the target collection. |
registry | Property for the ICollectionGetterRegistryTool instance. |
allowMissing | Property for the allowMissing flag. |
Constructor: for multiple targets.
- Parameters
-
targetLabel | Property for the label of the getter defining the target collection. If non-empty, this will be considered to be at the start of targetLabels. |
targetLabels | Property for the label of the getter defining the target collection. |
registry | Property for the ICollectionGetterRegistryTool instance. |
allowMissing | Property for the allowMissing flag. |
Definition at line 58 of file IndexMap.cxx.
◆ IndexMap() [3/3]
D3PD::IndexMap::IndexMap |
( |
INamedInterface * |
parent, |
|
|
ToolHandleArray< ICollectionGetterTool > & |
getters, |
|
|
const bool & |
allowMissing |
|
) |
| |
Constructor: passing the list of getters directly.
- Parameters
-
parent | The parent tool. |
getters | Property for the list of getters. |
allowMissing | Property for the allowMissing flag. |
Definition at line 80 of file IndexMap.cxx.
◆ addRef()
unsigned long D3PD::IndexMap::addRef |
( |
| ) |
|
|
virtual |
Dummies needed to satisfy IInterface requirements.
Definition at line 340 of file IndexMap.cxx.
◆ configureCommon()
StatusCode D3PD::IndexMap::configureCommon |
( |
| ) |
|
|
private |
Common part of configuration.
Definition at line 97 of file IndexMap.cxx.
100 CHECK( incSvc.retrieve() );
101 incSvc->addListener (
this,
"EndEvent");
108 ICollectionGetterTool*
target = 0;
114 ICollectionGetterTool*
target = 0;
128 return StatusCode::SUCCESS;
◆ configureD3PD() [1/2]
StatusCode D3PD::IndexMap::configureD3PD |
( |
| ) |
|
Configure during initialization: type-check.
If this is used, the pointer type passed in should match that of the target container(s).
Definition at line 137 of file IndexMap.cxx.
148 return StatusCode::SUCCESS;
◆ configureD3PD() [2/2]
StatusCode D3PD::IndexMap::configureD3PD |
( |
const std::type_info & |
ti | ) |
|
Configure during initialization: type-check.
- Parameters
-
The | pointer type that will be passed into the find methods. |
The | pointer type that will be passed into the find methods. |
If this is used, the pointer type passed in should match that of the target container(s).
Definition at line 159 of file IndexMap.cxx.
168 return StatusCode::SUCCESS;
◆ findIndex() [1/2]
int D3PD::IndexMap::findIndex |
( |
const void * |
p | ) |
|
Find the index corresponding to an element.
- Parameters
-
Returns -1 if the pointer isn't found.
Definition at line 255 of file IndexMap.cxx.
◆ findIndex() [2/2]
int D3PD::IndexMap::findIndex |
( |
const void * |
p, |
|
|
unsigned int |
i |
|
) |
| |
Find the index corresponding to an element within a specific container.
- Parameters
-
p | The pointer to find. |
i | The index of the target in which to search. |
Returns -1 if the pointer isn't found.
Definition at line 270 of file IndexMap.cxx.
277 if (
it->second.second ==
static_cast<int>(
i)) {
278 ret =
it->second.first;
◆ findIndexPair()
std::pair< int, int > D3PD::IndexMap::findIndexPair |
( |
const void * |
p | ) |
|
Find the (index,container) pair corresponding to an element.
- Parameters
-
Returns (-1,-1) if the pointer isn't found.
Definition at line 293 of file IndexMap.cxx.
296 std::pair<int, int>
ret (-1, -1);
304 if (
it->second.second <
ret.second)
◆ formatLabels()
std::string D3PD::IndexMap::formatLabels |
( |
| ) |
const |
Return list of all configured targets as a comma-separated string.
Definition at line 325 of file IndexMap.cxx.
◆ handle()
void D3PD::IndexMap::handle |
( |
const Incident & |
inc | ) |
|
|
virtual |
Incident handler.
- Parameters
-
Definition at line 214 of file IndexMap.cxx.
216 if (inc.type() ==
"EndEvent")
◆ ntargets()
int D3PD::IndexMap::ntargets |
( |
| ) |
|
Return the number of valid targets.
Definition at line 199 of file IndexMap.cxx.
◆ queryInterface()
StatusCode D3PD::IndexMap::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvInterface |
|
) |
| |
|
virtual |
Definition at line 342 of file IndexMap.cxx.
344 {
return StatusCode::FAILURE; }
◆ release()
unsigned long D3PD::IndexMap::release |
( |
| ) |
|
|
virtual |
◆ reset()
StatusCode D3PD::IndexMap::reset |
( |
| ) |
|
Call before asking for an index. Rebuilds cache if needed.
Call before asking for an index.
Rebuilds cache if needed.
Definition at line 227 of file IndexMap.cxx.
238 m_map.insert (std::make_pair (cobj, std::make_pair(
idx++, (
int)
i)));
245 return StatusCode::SUCCESS;
◆ target() [1/2]
Return the getter defining the first collection within which to index.
Definition at line 175 of file IndexMap.cxx.
◆ target() [2/2]
Return the getter defining the i'th collection within which to index.
Definition at line 188 of file IndexMap.cxx.
◆ valid()
bool D3PD::IndexMap::valid |
( |
| ) |
const |
◆ m_allowMissing
const bool& D3PD::IndexMap::m_allowMissing |
|
private |
◆ m_converters
◆ m_getters
◆ m_map
map_t D3PD::IndexMap::m_map |
|
private |
◆ m_parent
INamedInterface* D3PD::IndexMap::m_parent |
|
private |
◆ m_registry
◆ m_targetLabel
const std::string* D3PD::IndexMap::m_targetLabel |
|
private |
Property for the label of the getter defining the target collection.
Definition at line 180 of file IndexMap.h.
◆ m_targetLabels
const std::vector<std::string>* D3PD::IndexMap::m_targetLabels |
|
private |
Property for the label of the getter defining the list of target collections.
Definition at line 184 of file IndexMap.h.
◆ m_targets
Getters defining the collections within which to index.
Definition at line 196 of file IndexMap.h.
◆ m_valid
bool D3PD::IndexMap::m_valid |
|
private |
Flag if the map is valid.
Definition at line 203 of file IndexMap.h.
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
ICollectionGetterTool * target()
Return the getter defining the first collection within which to index.
INamedInterface * m_parent
The parent tool.
std::pair< int, int > findIndexPair(const void *p)
Find the (index,container) pair corresponding to an element.
StatusCode configureCommon()
Common part of configuration.
ToolHandleArray< ICollectionGetterTool > * m_getters
Property for a direct list of getters.
#define CHECK(...)
Evaluate an expression and check for errors.
const std::vector< std::string > * m_targetLabels
Property for the label of the getter defining the list of target collections.
std::vector< ICollectionGetterTool * > m_targets
Getters defining the collections within which to index.
def init(v_theApp, v_rootStream=None)
const bool & m_allowMissing
Property for the allowMissing flag.
bool m_valid
Flag if the map is valid.
const std::string * m_targetLabel
Property for the label of the getter defining the target collection.
std::vector< TypeConverter > m_converters
Converter for each target.
virtual const void * nextUntyped()=0
Return a pointer to the next element in the iteration.
ToolHandle< ICollectionGetterRegistryTool > * m_registry
Property for the ICollectionGetterRegistryTool instance.