#include <FUProxy.h>
Public Member Functions | |
FUProxy (xdaq::ApplicationDescriptor *smAppDesc, xdaq::ApplicationDescriptor *fuAppDesc, xdaq::ApplicationContext *smAppContext, toolbox::mem::Pool *msgPool) | |
void | sendDataDiscard (const int &rbBufferId) |
void | sendDQMDiscard (const int &rbBufferId) |
Private Member Functions | |
void | sendDiscardMsg (const int &rbBufferId, const int &msgId, const size_t &msgSize) |
Private Attributes | |
xdaq::ApplicationDescriptor * | fuAppDesc_ |
toolbox::mem::Pool * | msgPool_ |
xdaq::ApplicationContext * | smAppContext_ |
xdaq::ApplicationDescriptor * | smAppDesc_ |
Send back discards to the FU resource borker.
Following the example in EventFilter/ResourceBroker for BUProxy and SMProxy.
stor::FUProxy::FUProxy | ( | xdaq::ApplicationDescriptor * | smAppDesc, |
xdaq::ApplicationDescriptor * | fuAppDesc, | ||
xdaq::ApplicationContext * | smAppContext, | ||
toolbox::mem::Pool * | msgPool | ||
) |
Definition at line 23 of file FUProxy.cc.
: smAppDesc_(smAppDesc), fuAppDesc_(fuAppDesc), smAppContext_(smAppContext), msgPool_(msgPool) {}
void stor::FUProxy::sendDataDiscard | ( | const int & | rbBufferId | ) |
Definition at line 40 of file FUProxy.cc.
References I2O_FU_DATA_DISCARD, and sendDiscardMsg().
{ sendDiscardMsg(rbBufferId, I2O_FU_DATA_DISCARD, sizeof(I2O_FU_DATA_DISCARD_MESSAGE_FRAME)); }
void stor::FUProxy::sendDiscardMsg | ( | const int & | rbBufferId, |
const int & | msgId, | ||
const size_t & | msgSize | ||
) | [private] |
Definition at line 46 of file FUProxy.cc.
References alignCSCRings::e, Exception, lumiQueryAPI::msg, and _I2O_FU_DATA_DISCARD_MESSAGE_FRAME::rbBufferID.
Referenced by sendDataDiscard(), and sendDQMDiscard().
{ try { toolbox::mem::Reference* bufRef= toolbox::mem::getMemoryPoolFactory()->getFrame(msgPool_,msgSize); // message pointer I2O_MESSAGE_FRAME* stdMsg = (I2O_MESSAGE_FRAME*)bufRef->getDataLocation(); I2O_PRIVATE_MESSAGE_FRAME* pvtMsg = (I2O_PRIVATE_MESSAGE_FRAME*)stdMsg; I2O_FU_DATA_DISCARD_MESSAGE_FRAME* msg = (I2O_FU_DATA_DISCARD_MESSAGE_FRAME*)stdMsg; // set message frame stdMsg->MessageSize = msgSize >> 2; stdMsg->InitiatorAddress= i2o::utils::getAddressMap()->getTid(smAppDesc_); stdMsg->TargetAddress = i2o::utils::getAddressMap()->getTid(fuAppDesc_); stdMsg->Function = I2O_PRIVATE_MESSAGE; stdMsg->VersionOffset = 0; stdMsg->MsgFlags = 0; // set private message frame pvtMsg->XFunctionCode = msgId; pvtMsg->OrganizationID = XDAQ_ORGANIZATION_ID; // set fu data discard message frame msg->rbBufferID = rbBufferId; // set buffer size bufRef->setDataSize(msgSize); // post frame smAppContext_->postFrame(bufRef,smAppDesc_,fuAppDesc_); } catch (toolbox::mem::exception::Exception& e) { XCEPT_RETHROW(exception::IgnoredDiscard, "FUProxy failed to allocate buffer reference!", e); } catch (xcept::Exception &e) { XCEPT_RETHROW(exception::IgnoredDiscard, "FUProxy failed to post discard message!", e); } }
void stor::FUProxy::sendDQMDiscard | ( | const int & | rbBufferId | ) |
Definition at line 35 of file FUProxy.cc.
References I2O_FU_DQM_DISCARD, and sendDiscardMsg().
{ sendDiscardMsg(rbBufferId, I2O_FU_DQM_DISCARD, sizeof(I2O_FU_DQM_DISCARD_MESSAGE_FRAME)); }
xdaq::ApplicationDescriptor* stor::FUProxy::fuAppDesc_ [private] |
toolbox::mem::Pool* stor::FUProxy::msgPool_ [private] |
xdaq::ApplicationContext* stor::FUProxy::smAppContext_ [private] |
xdaq::ApplicationDescriptor* stor::FUProxy::smAppDesc_ [private] |