ATLAS Offline Software
|
#include <IndexMap.h>
Public Member Functions | |
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... | |
Private Types | |
typedef std::unordered_multimap< const void *, std::pair< int, int > > | map_t |
The pointer -> (index,target) map. More... | |
Private Member Functions | |
StatusCode | configureCommon () |
Common part of configuration. More... | |
Private Attributes | |
INamedInterface * | m_parent |
The parent tool. More... | |
const std::string * | m_targetLabel |
Property for the label of the getter defining the target collection. More... | |
const std::vector< std::string > * | m_targetLabels |
Property for the label of the getter defining the list of target collections. More... | |
ToolHandle< ICollectionGetterRegistryTool > * | m_registry |
Property for the ICollectionGetterRegistryTool instance. More... | |
ToolHandleArray< ICollectionGetterTool > * | m_getters |
Property for a direct list of getters. More... | |
const bool & | m_allowMissing |
Property for the allowMissing flag. More... | |
std::vector< ICollectionGetterTool * > | m_targets |
Getters defining the collections within which to index. More... | |
map_t | m_map |
bool | m_valid |
Flag if the map is valid. More... | |
std::vector< TypeConverter > | m_converters |
Converter for each target. More... | |
Definition at line 42 of file IndexMap.h.
|
private |
The pointer -> (index,target) map.
Definition at line 190 of file IndexMap.h.
D3PD::IndexMap::IndexMap | ( | INamedInterface * | parent, |
const std::string & | targetLabel, | ||
ToolHandle< ICollectionGetterRegistryTool > & | registry, | ||
const bool & | allowMissing | ||
) |
Constructor: for a single target.
parent | The parent tool. |
targetLabel | 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 31 of file IndexMap.cxx.
D3PD::IndexMap::IndexMap | ( | INamedInterface * | parent, |
const std::string & | targetLabel, | ||
const std::vector< std::string > & | targetLabels, | ||
ToolHandle< ICollectionGetterRegistryTool > & | registry, | ||
const bool & | allowMissing | ||
) |
Constructor: for multiple targets.
Constructor.
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.
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.
D3PD::IndexMap::IndexMap | ( | INamedInterface * | parent, |
ToolHandleArray< ICollectionGetterTool > & | getters, | ||
const bool & | allowMissing | ||
) |
Constructor: passing the list of getters directly.
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.
|
private |
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.
StatusCode D3PD::IndexMap::configureD3PD | ( | const std::type_info & | ti | ) |
Configure during initialization: type-check.
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.
int D3PD::IndexMap::findIndex | ( | const void * | p | ) |
Find the index corresponding to an element.
p | The pointer to find. |
Returns -1 if the pointer isn't found.
Definition at line 255 of file IndexMap.cxx.
int D3PD::IndexMap::findIndex | ( | const void * | p, |
unsigned int | i | ||
) |
Find the index corresponding to an element within a specific container.
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.
std::pair< int, int > D3PD::IndexMap::findIndexPair | ( | const void * | p | ) |
Find the (index,container) pair corresponding to an element.
p | The pointer to find. |
Returns (-1,-1) if the pointer isn't found.
Definition at line 293 of file IndexMap.cxx.
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.
|
virtual |
int D3PD::IndexMap::ntargets | ( | ) |
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.
ICollectionGetterTool * D3PD::IndexMap::target | ( | ) |
ICollectionGetterTool * D3PD::IndexMap::target | ( | unsigned int | i | ) |
bool D3PD::IndexMap::valid | ( | ) | const |
|
private |
Property for the allowMissing flag.
Definition at line 184 of file IndexMap.h.
|
private |
Converter for each target.
Definition at line 197 of file IndexMap.h.
|
private |
Property for a direct list of getters.
Definition at line 181 of file IndexMap.h.
|
private |
Definition at line 191 of file IndexMap.h.
|
private |
The parent tool.
Definition at line 168 of file IndexMap.h.
|
private |
Property for the ICollectionGetterRegistryTool instance.
Definition at line 178 of file IndexMap.h.
|
private |
Property for the label of the getter defining the target collection.
Definition at line 171 of file IndexMap.h.
|
private |
Property for the label of the getter defining the list of target collections.
Definition at line 175 of file IndexMap.h.
|
private |
Getters defining the collections within which to index.
Definition at line 187 of file IndexMap.h.
|
private |
Flag if the map is valid.
Definition at line 194 of file IndexMap.h.