8 #include <toolbox/mem/Reference.h>
9 #include <toolbox/mem/MemoryPoolFactory.h>
10 #include <toolbox/mem/exception/Exception.h>
12 #include <i2o/Method.h>
13 #include <i2o/utils/AddressMap.h>
15 #include <xcept/tools.h>
24 xdaq::ApplicationDescriptor *smAppDesc,
25 xdaq::ApplicationDescriptor *fuAppDesc,
26 xdaq::ApplicationContext *smAppContext,
27 toolbox::mem::Pool *msgPool
29 : smAppDesc_(smAppDesc),
30 fuAppDesc_(fuAppDesc),
31 smAppContext_(smAppContext),
47 const int& rbBufferId,
53 toolbox::mem::Reference* bufRef=
54 toolbox::mem::getMemoryPoolFactory()->getFrame(msgPool_,msgSize);
57 I2O_MESSAGE_FRAME* stdMsg =
58 (I2O_MESSAGE_FRAME*)bufRef->getDataLocation();
59 I2O_PRIVATE_MESSAGE_FRAME* pvtMsg =
60 (I2O_PRIVATE_MESSAGE_FRAME*)stdMsg;
65 stdMsg->MessageSize = msgSize >> 2;
66 stdMsg->InitiatorAddress= i2o::utils::getAddressMap()->getTid(smAppDesc_);
67 stdMsg->TargetAddress = i2o::utils::getAddressMap()->getTid(fuAppDesc_);
68 stdMsg->Function = I2O_PRIVATE_MESSAGE;
69 stdMsg->VersionOffset = 0;
73 pvtMsg->XFunctionCode = msgId;
74 pvtMsg->OrganizationID = XDAQ_ORGANIZATION_ID;
80 bufRef->setDataSize(msgSize);
83 smAppContext_->postFrame(bufRef,smAppDesc_,fuAppDesc_);
87 XCEPT_RETHROW(exception::IgnoredDiscard,
88 "FUProxy failed to allocate buffer reference!", e);
92 XCEPT_RETHROW(exception::IgnoredDiscard,
93 "FUProxy failed to post discard message!", e);
FUProxy(xdaq::ApplicationDescriptor *smAppDesc, xdaq::ApplicationDescriptor *fuAppDesc, xdaq::ApplicationContext *smAppContext, toolbox::mem::Pool *msgPool)
void sendDiscardMsg(const int &rbBufferId, const int &msgId, const size_t &msgSize)
#define I2O_FU_DQM_DISCARD
void sendDQMDiscard(const int &rbBufferId)
#define I2O_FU_DATA_DISCARD
void sendDataDiscard(const int &rbBufferId)