CMS 3D CMS Logo

stor::FUProxy Class Reference

#include <EventFilter/StorageManager/interface/FUProxy.h>

List of all members.

Public Member Functions

 FUProxy (xdaq::ApplicationDescriptor *, xdaq::ApplicationDescriptor *, xdaq::ApplicationContext *, toolbox::mem::Pool *)
int sendDataDiscard (int)
int sendDQMDiscard (int)
virtual ~FUProxy ()

Private Member Functions

int sendDiscard (int, int) throw (evf::Exception)

Private Attributes

xdaq::ApplicationDescriptor * fuAppDesc_
toolbox::mem::Pool * i2oPool_
xdaq::ApplicationContext * smAppContext_
xdaq::ApplicationDescriptor * smAppDesc_


Detailed Description

Definition at line 22 of file FUProxy.h.


Constructor & Destructor Documentation

FUProxy::FUProxy ( xdaq::ApplicationDescriptor *  smAppDesc,
xdaq::ApplicationDescriptor *  fuAppDesc,
xdaq::ApplicationContext *  smAppContext,
toolbox::mem::Pool *  i2oPool 
)

Definition at line 23 of file FUProxy.cc.

00027   : smAppDesc_(smAppDesc)
00028   , fuAppDesc_(fuAppDesc)
00029   , smAppContext_(smAppContext)
00030   , i2oPool_(i2oPool)
00031 {
00032 
00033 }

FUProxy::~FUProxy (  )  [virtual]

Definition at line 37 of file FUProxy.cc.

00038 {
00039 
00040 }


Member Function Documentation

int FUProxy::sendDataDiscard ( int  rbBufferId  ) 

Definition at line 51 of file FUProxy.cc.

References I2O_FU_DATA_DISCARD, and sendDiscard().

00052 {
00053   return sendDiscard(rbBufferId, I2O_FU_DATA_DISCARD);
00054 }

int FUProxy::sendDiscard ( int  rbBufferId,
int  msgId 
) throw (evf::Exception) [private]

Definition at line 58 of file FUProxy.cc.

References e, Exception, fuAppDesc_, i2oPool_, alivecheck_mergeAndRegister::msg, _I2O_FU_DATA_DISCARD_MESSAGE_FRAME::rbBufferID, smAppContext_, and smAppDesc_.

Referenced by sendDataDiscard(), and sendDQMDiscard().

00060 {
00061   try {
00062     size_t msgSize=sizeof(I2O_FU_DATA_DISCARD_MESSAGE_FRAME);
00063     
00064     toolbox::mem::Reference *bufRef=
00065       toolbox::mem::getMemoryPoolFactory()->getFrame(i2oPool_,msgSize);
00066 
00067     // message pointer
00068     I2O_MESSAGE_FRAME *stdMsg = 
00069       (I2O_MESSAGE_FRAME*)bufRef->getDataLocation();
00070     I2O_PRIVATE_MESSAGE_FRAME *pvtMsg =
00071       (I2O_PRIVATE_MESSAGE_FRAME*)stdMsg;
00072     I2O_FU_DATA_DISCARD_MESSAGE_FRAME *msg =
00073       (I2O_FU_DATA_DISCARD_MESSAGE_FRAME*)stdMsg;
00074     
00075     // set message frame
00076     stdMsg->MessageSize     = msgSize >> 2;
00077     stdMsg->InitiatorAddress= i2o::utils::getAddressMap()->getTid(smAppDesc_);
00078     stdMsg->TargetAddress   = i2o::utils::getAddressMap()->getTid(fuAppDesc_);
00079     stdMsg->Function        = I2O_PRIVATE_MESSAGE;
00080     stdMsg->VersionOffset   = 0;
00081     stdMsg->MsgFlags        = 0;  
00082  
00083     // set private message frame
00084     pvtMsg->XFunctionCode   =  msgId;
00085     pvtMsg->OrganizationID  = XDAQ_ORGANIZATION_ID;
00086 
00087     // set fu data discard message frame
00088     msg->rbBufferID         = rbBufferId;
00089 
00090      // set buffer size
00091     bufRef->setDataSize(msgSize);
00092 
00093     // post frame
00094     smAppContext_->postFrame(bufRef,smAppDesc_,fuAppDesc_);
00095   }
00096   catch (xdaq::exception::Exception &e) {
00097     std::ostringstream oss;
00098     oss << "FUProxy failed to post message! " 
00099         << " What: "              << e.what()
00100         << " Exception history: " << xcept::stdformat_exception_history(e);
00101     LOG4CPLUS_ERROR(smAppContext_->getLogger(), oss.str());
00102     XCEPT_RETHROW(evf::Exception, oss.str(), e);
00103   }
00104   catch(toolbox::mem::exception::Exception& e)  {
00105     std::ostringstream oss;
00106     oss << "FUProxy failed to allocate buffer reference! " 
00107         << " What: "              << e.what()
00108         << " Exception history: " << xcept::stdformat_exception_history(e);
00109     LOG4CPLUS_ERROR(smAppContext_->getLogger(), oss.str());
00110     XCEPT_RETHROW(evf::Exception, oss.str(), e);
00111   }
00112   return 0;
00113 }

int FUProxy::sendDQMDiscard ( int  rbBufferId  ) 

Definition at line 44 of file FUProxy.cc.

References I2O_FU_DQM_DISCARD, and sendDiscard().

00045 {
00046   return sendDiscard(rbBufferId, I2O_FU_DQM_DISCARD);
00047 }


Member Data Documentation

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

Definition at line 39 of file FUProxy.h.

Referenced by sendDiscard().

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

Definition at line 41 of file FUProxy.h.

Referenced by sendDiscard().

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

Definition at line 40 of file FUProxy.h.

Referenced by sendDiscard().

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

Definition at line 38 of file FUProxy.h.

Referenced by sendDiscard().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:52:51 2009 for CMSSW by  doxygen 1.5.4