CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
stor::FUProxy Class Reference

#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_
 

Detailed Description

Send back discards to the FU resource borker.

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

Author:
mommsen
Revision:
1.7
Date:
2011/03/07 15:31:31

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.

29  : smAppDesc_(smAppDesc),
30  fuAppDesc_(fuAppDesc),
31  smAppContext_(smAppContext),
32  msgPool_(msgPool)
33  {}
toolbox::mem::Pool * msgPool_
Definition: FUProxy.h:50
xdaq::ApplicationContext * smAppContext_
Definition: FUProxy.h:49
xdaq::ApplicationDescriptor * fuAppDesc_
Definition: FUProxy.h:48
xdaq::ApplicationDescriptor * smAppDesc_
Definition: FUProxy.h:47

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

41  {
43  }
void sendDiscardMsg(const int &rbBufferId, const int &msgId, const size_t &msgSize)
Definition: FUProxy.cc:46
#define I2O_FU_DATA_DISCARD
Definition: i2oEvfMsgs.h:26
void stor::FUProxy::sendDiscardMsg ( const int &  rbBufferId,
const int &  msgId,
const size_t &  msgSize 
)
private

Definition at line 46 of file FUProxy.cc.

References edm::hlt::Exception, runTheMatrix::msg, and _I2O_FU_DATA_DISCARD_MESSAGE_FRAME::rbBufferID.

Referenced by sendDataDiscard(), and sendDQMDiscard().

51  {
52  try {
53  toolbox::mem::Reference* bufRef=
54  toolbox::mem::getMemoryPoolFactory()->getFrame(msgPool_,msgSize);
55 
56  // message pointer
57  I2O_MESSAGE_FRAME* stdMsg =
58  (I2O_MESSAGE_FRAME*)bufRef->getDataLocation();
59  I2O_PRIVATE_MESSAGE_FRAME* pvtMsg =
60  (I2O_PRIVATE_MESSAGE_FRAME*)stdMsg;
63 
64  // set message frame
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;
70  stdMsg->MsgFlags = 0;
71 
72  // set private message frame
73  pvtMsg->XFunctionCode = msgId;
74  pvtMsg->OrganizationID = XDAQ_ORGANIZATION_ID;
75 
76  // set fu data discard message frame
77  msg->rbBufferID = rbBufferId;
78 
79  // set buffer size
80  bufRef->setDataSize(msgSize);
81 
82  // post frame
83  smAppContext_->postFrame(bufRef,smAppDesc_,fuAppDesc_);
84  }
86  {
87  XCEPT_RETHROW(exception::IgnoredDiscard,
88  "FUProxy failed to allocate buffer reference!", e);
89  }
90  catch (xcept::Exception &e)
91  {
92  XCEPT_RETHROW(exception::IgnoredDiscard,
93  "FUProxy failed to post discard message!", e);
94  }
95  }
toolbox::mem::Pool * msgPool_
Definition: FUProxy.h:50
xdaq::ApplicationContext * smAppContext_
Definition: FUProxy.h:49
xdaq::ApplicationDescriptor * fuAppDesc_
Definition: FUProxy.h:48
xdaq::ApplicationDescriptor * smAppDesc_
Definition: FUProxy.h:47
void stor::FUProxy::sendDQMDiscard ( const int &  rbBufferId)

Definition at line 35 of file FUProxy.cc.

References I2O_FU_DQM_DISCARD, and sendDiscardMsg().

36  {
38  }
void sendDiscardMsg(const int &rbBufferId, const int &msgId, const size_t &msgSize)
Definition: FUProxy.cc:46
#define I2O_FU_DQM_DISCARD
Definition: i2oEvfMsgs.h:27

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.