12 #include "toolbox/mem/HeapAllocator.h"
13 #include "toolbox/mem/MemoryPoolFactory.h"
14 #include "toolbox/net/URN.h"
21 xdaq::ApplicationContext* ctx,
22 xdaq::ApplicationDescriptor* desc,
27 dataSenderMonCollection_(dsmc)
29 std::ostringstream poolName;
30 poolName << desc->getClassName() << desc->getInstance();
31 toolbox::net::URN urn(
"toolbox-mem-pool", poolName.str());
32 toolbox::mem::HeapAllocator*
a =
new toolbox::mem::HeapAllocator();
34 msgPool_ = toolbox::mem::getMemoryPoolFactory()->createPool(urn, a);
50 unsigned int rbBufferId = i2oMessage.
rbBufferId();
52 unsigned int hltInstance = i2oMessage.
hltInstance();
54 if (fuProxyPtr.get() == 0)
57 std::stringstream
msg;
58 msg <<
"Unable to find the resource broker corresponding to ";
59 msg <<
"classname = \"";
61 msg <<
"\" and instance = \"";
64 XCEPT_RAISE(exception::RBLookupFailed, msg.str());
70 fuProxyPtr->sendDQMDiscard(rbBufferId);
75 fuProxyPtr->sendDataDiscard(rbBufferId);
86 std::string
const& hltClassName,
87 unsigned int const& hltInstance
90 HLTSenderKey mapKey = std::make_pair(hltClassName, hltInstance);
91 FUProxyMap::iterator
pos = proxyCache_.lower_bound(mapKey);
93 if (pos == proxyCache_.end() || (proxyCache_.key_comp()(mapKey, pos->first)))
96 FUProxyPtr fuProxyPtr = makeNewFUProxy(hltClassName, hltInstance);
97 if (fuProxyPtr.get() != 0)
111 std::string
const& hltClassName,
112 unsigned int const& hltInstance
116 std::set<xdaq::ApplicationDescriptor*> setOfRBs=
117 appContext_->getDefaultZone()->
118 getApplicationDescriptors(hltClassName.c_str());
120 std::set<xdaq::ApplicationDescriptor*>::iterator iter;
121 std::set<xdaq::ApplicationDescriptor*>::iterator iterEnd = setOfRBs.end();
123 for (iter = setOfRBs.begin(); iter != iterEnd; ++iter)
125 if ((*iter)->getInstance() == hltInstance)
127 proxyPtr.reset(
new FUProxy(appDescriptor_, *iter,
128 appContext_, msgPool_));
void incrementDataDiscardCount(I2OChain const &)
std::pair< std::string, unsigned int > HLTSenderKey
std::string hltClassName() const
void incrementSkippedDiscardCount(I2OChain const &)
void incrementDQMDiscardCount(I2OChain const &)
FUProxyPtr getProxyFromCache(std::string const &hltClassName, unsigned int const &hltInstance)
unsigned int messageCode() const
unsigned int hltInstance() const
boost::shared_ptr< FUProxy > FUProxyPtr
FUProxyPtr makeNewFUProxy(std::string const &hltClassName, unsigned int const &hltInstance)
Container::value_type value_type
unsigned int rbBufferId() const
DiscardManager(xdaq::ApplicationContext *, xdaq::ApplicationDescriptor *, DataSenderMonitorCollection &)
DataSenderMonitorCollection & dataSenderMonCollection_
bool sendDiscardMessage(I2OChain const &)