CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

stor::FUProxy Class Reference

#include <FUProxy.h>

List of all members.

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_

Detailed Description

Send back discards to the FU resource borker.

Following the example in EventFilter/ResourceBroker for BUProxy and SMProxy.

Author:
mommsen
Revision:
1.8
Date:
2011/04/07 08:02:03

Definition at line 25 of file FUProxy.h.


Constructor & Destructor Documentation

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)
  {}

Member Function Documentation

void stor::FUProxy::sendDataDiscard ( const int &  rbBufferId)

Definition at line 40 of file FUProxy.cc.

References I2O_FU_DATA_DISCARD, and sendDiscardMsg().

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().


Member Data Documentation

xdaq::ApplicationDescriptor* stor::FUProxy::fuAppDesc_ [private]

Definition at line 48 of file FUProxy.h.

toolbox::mem::Pool* stor::FUProxy::msgPool_ [private]

Definition at line 50 of file FUProxy.h.

xdaq::ApplicationContext* stor::FUProxy::smAppContext_ [private]

Definition at line 49 of file FUProxy.h.

xdaq::ApplicationDescriptor* stor::FUProxy::smAppDesc_ [private]

Definition at line 47 of file FUProxy.h.