CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

evf::FUShmDqmCell Class Reference

#include <FUShmDqmCell.h>

List of all members.

Public Member Functions

void clear ()
unsigned int eventSize () const
unsigned int evtAtUpdate () const
unsigned int folderId () const
unsigned int fuGuid () const
unsigned int fuProcessId () const
 FUShmDqmCell (unsigned int payloadSize)
unsigned int index () const
void initialize (unsigned int index)
unsigned char * payloadAddr () const
unsigned int payloadSize () const
unsigned int runNumber () const
void writeData (unsigned int runNumber, unsigned int evtAtUpdate, unsigned int folderId, unsigned int fuProcessId, unsigned int fuGuid, unsigned char *data, unsigned int dataSize)
 ~FUShmDqmCell ()

Static Public Member Functions

static unsigned int size (unsigned int payloadSize)

Private Attributes

unsigned int eventSize_
unsigned int evtAtUpdate_
unsigned int folderId_
unsigned int fuGuid_
unsigned int fuProcessId_
unsigned int index_
unsigned int payloadOffset_
unsigned int payloadSize_
unsigned int runNumber_

Detailed Description

Definition at line 7 of file FUShmDqmCell.h.


Constructor & Destructor Documentation

FUShmDqmCell::FUShmDqmCell ( unsigned int  payloadSize)

Definition at line 25 of file FUShmDqmCell.cc.

References payloadAddr(), payloadOffset_, and payloadSize_.

Referenced by size().

  : payloadSize_(payloadSize)
{
  payloadOffset_=sizeof(FUShmDqmCell);
  void* payloadAddr=(void*)((unsigned long)this+payloadOffset_);
  new (payloadAddr) unsigned char[payloadSize_];
}
FUShmDqmCell::~FUShmDqmCell ( )

Definition at line 35 of file FUShmDqmCell.cc.

Referenced by evf::DQMMsgBuf::~DQMMsgBuf().

{

}

Member Function Documentation

void FUShmDqmCell::clear ( void  )
unsigned int evf::FUShmDqmCell::eventSize ( ) const [inline]
unsigned int evf::FUShmDqmCell::evtAtUpdate ( ) const [inline]
unsigned int evf::FUShmDqmCell::folderId ( ) const [inline]
unsigned int evf::FUShmDqmCell::fuGuid ( ) const [inline]
unsigned int evf::FUShmDqmCell::fuProcessId ( ) const [inline]
unsigned int evf::FUShmDqmCell::index ( ) const [inline]
void FUShmDqmCell::initialize ( unsigned int  index)

Definition at line 46 of file FUShmDqmCell.cc.

References clear(), index(), and index_.

Referenced by evf::FUShmBuffer::reset().

{
  index_=index;
  clear();
}
unsigned char * FUShmDqmCell::payloadAddr ( ) const

Definition at line 54 of file FUShmDqmCell.cc.

References payloadOffset_, and query::result.

Referenced by FUShmDqmCell(), evf::FUResourceTable::sendDqm(), evf::FUResourceQueue::sendDqm(), evf::FUResourceQueue::sendDqmWhileHalting(), and writeData().

{
  unsigned char* result=(unsigned char*)((unsigned long)this+payloadOffset_);
  return result;
}
unsigned int evf::FUShmDqmCell::payloadSize ( ) const [inline]

Definition at line 29 of file FUShmDqmCell.h.

References payloadSize_.

Referenced by size().

{ return payloadSize_; }
unsigned int evf::FUShmDqmCell::runNumber ( ) const [inline]
unsigned int FUShmDqmCell::size ( unsigned int  payloadSize) [static]

Definition at line 97 of file FUShmDqmCell.cc.

References FUShmDqmCell(), and payloadSize().

{
  return sizeof(FUShmDqmCell)+sizeof(unsigned char)*payloadSize;
}
void FUShmDqmCell::writeData ( unsigned int  runNumber,
unsigned int  evtAtUpdate,
unsigned int  folderId,
unsigned int  fuProcessId,
unsigned int  fuGuid,
unsigned char *  data,
unsigned int  dataSize 
)

Definition at line 69 of file FUShmDqmCell.cc.

References gather_cfg::cout, eventSize_, evtAtUpdate(), evtAtUpdate_, folderId(), folderId_, fuGuid(), fuGuid_, fuProcessId(), fuProcessId_, payloadAddr(), payloadSize_, runNumber(), and runNumber_.

Referenced by evf::FUShmBuffer::writeDqmEventData().

{
  if (eventSize_!=0)
    cout<<"FUShmDqmCell::writeData WARNING: overwriting data!"<<endl;
  
  if (dataSize>payloadSize_) {
    cout<<"FUShmDqmCell::writeData ERROR: data does not fit!"<<endl;
    return;
  }
  
  runNumber_  =runNumber;
  evtAtUpdate_=evtAtUpdate;
  folderId_   =folderId;
  fuProcessId_=fuProcessId;
  fuGuid_     =fuGuid;
  unsigned char* targetAddr=payloadAddr();
  memcpy(targetAddr,data,dataSize);
  eventSize_=dataSize;
}

Member Data Documentation

unsigned int evf::FUShmDqmCell::eventSize_ [private]

Definition at line 62 of file FUShmDqmCell.h.

Referenced by clear(), eventSize(), and writeData().

unsigned int evf::FUShmDqmCell::evtAtUpdate_ [private]

Definition at line 56 of file FUShmDqmCell.h.

Referenced by evtAtUpdate(), and writeData().

unsigned int evf::FUShmDqmCell::folderId_ [private]

Definition at line 57 of file FUShmDqmCell.h.

Referenced by folderId(), and writeData().

unsigned int evf::FUShmDqmCell::fuGuid_ [private]

Definition at line 59 of file FUShmDqmCell.h.

Referenced by fuGuid(), and writeData().

unsigned int evf::FUShmDqmCell::fuProcessId_ [private]

Definition at line 58 of file FUShmDqmCell.h.

Referenced by fuProcessId(), and writeData().

unsigned int evf::FUShmDqmCell::index_ [private]

Definition at line 54 of file FUShmDqmCell.h.

Referenced by index(), and initialize().

unsigned int evf::FUShmDqmCell::payloadOffset_ [private]

Definition at line 61 of file FUShmDqmCell.h.

Referenced by FUShmDqmCell(), and payloadAddr().

unsigned int evf::FUShmDqmCell::payloadSize_ [private]

Definition at line 60 of file FUShmDqmCell.h.

Referenced by FUShmDqmCell(), payloadSize(), and writeData().

unsigned int evf::FUShmDqmCell::runNumber_ [private]

Definition at line 55 of file FUShmDqmCell.h.

Referenced by runNumber(), and writeData().