56 size_t msgSize =
sizeof(I2O_BU_ALLOCATE_MESSAGE_FRAME)
57 +
sizeof(BU_ALLOCATE) * (fuResourceIds.size() - 1);
59 toolbox::mem::Reference *bufRef =
60 toolbox::mem::getMemoryPoolFactory()->getFrame(
i2oPool_,
63 I2O_MESSAGE_FRAME *stdMsg;
64 I2O_PRIVATE_MESSAGE_FRAME *pvtMsg;
65 I2O_BU_ALLOCATE_MESSAGE_FRAME *
msg;
67 stdMsg = (I2O_MESSAGE_FRAME*) bufRef->getDataLocation();
68 pvtMsg = (I2O_PRIVATE_MESSAGE_FRAME*) stdMsg;
69 msg = (I2O_BU_ALLOCATE_MESSAGE_FRAME*) stdMsg;
71 stdMsg->MessageSize = msgSize >> 2;
72 stdMsg->InitiatorAddress = i2o::utils::getAddressMap()->getTid(
74 stdMsg->TargetAddress = i2o::utils::getAddressMap()->getTid(
buAppDesc_);
75 stdMsg->Function = I2O_PRIVATE_MESSAGE;
76 stdMsg->VersionOffset = 0;
79 pvtMsg->XFunctionCode = I2O_BU_ALLOCATE;
80 pvtMsg->OrganizationID = XDAQ_ORGANIZATION_ID;
82 msg->n = fuResourceIds.size();
84 for (
UInt_t i = 0;
i < fuResourceIds.size();
i++) {
85 msg->allocate[
i].fuTransactionId = fuResourceIds[
i];
86 msg->allocate[
i].fset = 1;
89 bufRef->setDataSize(msgSize);
93 string errmsg =
"Failed to allocate buffer reference.";
94 LOG4CPLUS_ERROR(log, errmsg);
96 }
catch (xdaq::exception::ApplicationDescriptorNotFound& e) {
97 string errmsg =
"Failed to get tid.";
98 LOG4CPLUS_ERROR(log, errmsg);
101 string errmsg =
"Failed to post 'Allocate' message.";
102 LOG4CPLUS_ERROR(log, errmsg);
xdaq::ApplicationDescriptor * buAppDesc_
xdaq::ApplicationDescriptor * fuAppDesc_
xdaq::ApplicationContext * fuAppContext_
toolbox::mem::Pool * i2oPool_