CMS 3D CMS Logo

Public Member Functions | Private Attributes

evf::FUShmServer Class Reference

#include <FUShmServer.h>

List of all members.

Public Member Functions

 FUShmServer (FUShmBuffer *buffer)
unsigned int writeNext (unsigned char *data, unsigned int nFed, unsigned int *fedSize)
 ~FUShmServer ()

Private Attributes

FUShmBufferbuffer_

Detailed Description

Definition at line 11 of file FUShmServer.h.


Constructor & Destructor Documentation

FUShmServer::FUShmServer ( FUShmBuffer buffer)

Definition at line 25 of file FUShmServer.cc.

  : buffer_(buffer)
{
  
}
FUShmServer::~FUShmServer ( )

Definition at line 33 of file FUShmServer.cc.

{
  
}

Member Function Documentation

unsigned int FUShmServer::writeNext ( unsigned char *  data,
unsigned int  nFed,
unsigned int *  fedSize 
)

Definition at line 44 of file FUShmServer.cc.

References buffer_, evf::FUShmRawCell::clear(), evf::FUShmBuffer::finishWritingRawCell(), i, evf::FUShmRawCell::index(), evf::FUShmRawCell::markFed(), evf::FUShmBuffer::printEvtState(), evf::FUShmBuffer::rawCellToWrite(), and evf::FUShmRawCell::writeData().

Referenced by main().

{
  FUShmRawCell* cell =buffer_->rawCellToWrite();
  buffer_->printEvtState(cell->index());
  
  // write data
  cell->clear();
  unsigned int dataSize(0);
  for (unsigned int i=0;i<nFed;i++) dataSize+=fedSize[i];
  unsigned int   iCell         =cell->index();
  unsigned char *cellBufferAddr=cell->writeData(data,dataSize);
  
  if (0!=cellBufferAddr) {
    // mark feds
    unsigned int fedOffset(0);
    for (unsigned int i=0;i<nFed;i++) {
      unsigned char* fedAddr=cellBufferAddr+fedOffset;
      cell->markFed(i,fedSize[i],fedAddr);
      fedOffset+=fedSize[i];
    }
    
    buffer_->finishWritingRawCell(cell);
  }
  
  return iCell;
}

Member Data Documentation

Definition at line 33 of file FUShmServer.h.

Referenced by writeNext().