23#ifndef D3PDMAKERUTILS_INDEXMAP_HPP
24#define D3PDMAKERUTILS_INDEXMAP_HPP
29#include "GaudiKernel/IIncidentListener.h"
30#include "GaudiKernel/ToolHandle.h"
33#include <unordered_map>
43 :
public implements<IIncidentListener>
55 const std::string& targetLabel,
56 ToolHandle<ICollectionGetterRegistryTool>& registry,
57 const bool& allowMissing);
73 const std::string& targetLabel,
74 const std::vector<std::string>& targetLabels,
75 ToolHandle<ICollectionGetterRegistryTool>& registry,
76 const bool& allowMissing);
86 ToolHandleArray<ICollectionGetterTool>& getters,
87 const bool& allowMissing);
116 virtual void handle (
const Incident &inc);
140 int findIndex (
const void* p,
unsigned int i);
190 typedef std::unordered_multimap<const void*, std::pair<int, int> >
map_t;
Helper to convert pointers.
ToolHandleArray< ICollectionGetterTool > * m_getters
Property for a direct list of getters.
std::vector< ICollectionGetterTool * > m_targets
Getters defining the collections within which to index.
const bool & m_allowMissing
Property for the allowMissing flag.
std::vector< TypeConverter > m_converters
Converter for each target.
ICollectionGetterTool * target()
Return the getter defining the first collection within which to index.
std::unordered_multimap< const void *, std::pair< int, int > > map_t
The pointer -> (index,target) map.
int ntargets()
Return the number of valid targets.
const std::string * m_targetLabel
Property for the label of the getter defining the target collection.
std::string formatLabels() const
Return list of all configured targets as a comma-separated string.
bool m_valid
Flag if the map is valid.
std::pair< int, int > findIndexPair(const void *p)
Find the (index,container) pair corresponding to an element.
virtual void handle(const Incident &inc)
Incident handler.
StatusCode configureD3PD()
Configure during initialization: type-check.
StatusCode reset()
Call before asking for an index. Rebuilds cache if needed.
INamedInterface * m_parent
The parent tool.
IndexMap(INamedInterface *parent, const std::string &targetLabel, ToolHandle< ICollectionGetterRegistryTool > ®istry, const bool &allowMissing)
Constructor: for a single target.
int findIndex(const void *p)
Find the index corresponding to an element.
ToolHandle< ICollectionGetterRegistryTool > * m_registry
Property for the ICollectionGetterRegistryTool instance.
bool valid() const
Return the valid flag.
StatusCode configureCommon()
Common part of configuration.
const std::vector< std::string > * m_targetLabels
Property for the label of the getter defining the list of target collections.
Block filler tool for noisy FEB information.