16#include "GaudiKernel/ServiceHandle.h"
17#include "GaudiKernel/IIncidentSvc.h"
32 const std::string& targetLabel,
33 ToolHandle<ICollectionGetterRegistryTool>& registry,
34 const bool& allowMissing)
59 const std::string& targetLabel,
60 const std::vector<std::string>& targetLabels,
61 ToolHandle<ICollectionGetterRegistryTool>& registry,
62 const bool& allowMissing)
81 ToolHandleArray<ICollectionGetterTool>& getters,
82 const bool& allowMissing)
100 CHECK( incSvc.retrieve() );
101 incSvc->addListener (
this,
"EndEvent");
123 for (
size_t i = 0; i <
m_getters->size(); i++)
128 return StatusCode::SUCCESS;
143 for (
size_t i = 0; i <
m_targets.size(); i++) {
148 return StatusCode::SUCCESS;
164 for (
size_t i = 0; i <
m_targets.size(); i++) {
168 return StatusCode::SUCCESS;
177 for (
size_t i = 0; i <
m_targets.size(); i++) {
202 for (
size_t i = 0; i <
m_targets.size(); i++) {
216 if (inc.type() ==
"EndEvent")
230 for (
size_t i = 0; i <
m_targets.size(); i++) {
235 while (
const void* obj =
target->nextUntyped() ) {
236 const void* cobj =
m_converters[i].convertUntyped (obj);
238 m_map.insert (std::make_pair (cobj, std::make_pair(idx++, (
int)i)));
239 target->releaseObjectUntyped (obj);
245 return StatusCode::SUCCESS;
273 for (map_t::iterator it =
m_map.find (p);
274 it !=
m_map.end() && it->first == p;
277 if (it->second.second ==
static_cast<int>(i)) {
278 ret = it->second.first;
295 map_t::iterator it =
m_map.find (p);
296 std::pair<int, int> ret (-1, -1);
297 if (it ==
m_map.end())
303 for (++it; it !=
m_map.end() && it->first == p; ++it) {
304 if (it->second.second < ret.second)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Cache pointer -> index mappings for a Getter used for index assocs.
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.
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.