#include <FUShmServer.h>
Public Member Functions | |
FUShmServer (FUShmBuffer *buffer) | |
unsigned int | writeNext (unsigned char *data, unsigned int nFed, unsigned int *fedSize) |
~FUShmServer () | |
Private Attributes | |
FUShmBuffer * | buffer_ |
Definition at line 11 of file FUShmServer.h.
FUShmServer::FUShmServer | ( | FUShmBuffer * | buffer | ) |
Definition at line 25 of file FUShmServer.cc.
: buffer_(buffer) { }
FUShmServer::~FUShmServer | ( | ) |
Definition at line 33 of file FUShmServer.cc.
{ }
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; }
FUShmBuffer* evf::FUShmServer::buffer_ [private] |
Definition at line 33 of file FUShmServer.h.
Referenced by writeNext().