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 Attributes
evf::FUShmServer Class Reference

#include <FUShmServer.h>

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.

26  : buffer_(buffer)
27 {
28 
29 }
FUShmBuffer * buffer_
Definition: FUShmServer.h:33
FUShmServer::~FUShmServer ( )

Definition at line 33 of file FUShmServer.cc.

34 {
35 
36 }

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

47 {
49  buffer_->printEvtState(cell->index());
50 
51  // write data
52  cell->clear();
53  unsigned int dataSize(0);
54  for (unsigned int i=0;i<nFed;i++) dataSize+=fedSize[i];
55  unsigned int iCell =cell->index();
56  unsigned char *cellBufferAddr=cell->writeData(data,dataSize);
57 
58  if (0!=cellBufferAddr) {
59  // mark feds
60  unsigned int fedOffset(0);
61  for (unsigned int i=0;i<nFed;i++) {
62  unsigned char* fedAddr=cellBufferAddr+fedOffset;
63  cell->markFed(i,fedSize[i],fedAddr);
64  fedOffset+=fedSize[i];
65  }
66 
68  }
69 
70  return iCell;
71 }
int i
Definition: DBlmapReader.cc:9
unsigned char * writeData(unsigned char *data, unsigned int dataSize)
bool markFed(unsigned int i, unsigned int size, unsigned char *addr)
FUShmBuffer * buffer_
Definition: FUShmServer.h:33
void finishWritingRawCell(FUShmRawCell *cell)
Definition: FUShmBuffer.cc:393
FUShmRawCell * rawCellToWrite()
Definition: FUShmBuffer.cc:298
unsigned int index() const
Definition: FUShmRawCell.h:25
void printEvtState(unsigned int index)
Definition: FUShmBuffer.cc:878
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82

Member Data Documentation

FUShmBuffer* evf::FUShmServer::buffer_
private

Definition at line 33 of file FUShmServer.h.

Referenced by writeNext().