CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FUShmServer.cc
Go to the documentation of this file.
1 //
3 // FUShmServer
4 // -----------
5 //
6 // 17/11/2006 Philipp Schieferdecker <philipp.schieferdecker@cern.ch>
8 
9 
11 
12 
13 #include <iostream>
14 
15 
16 using namespace std;
17 using namespace evf;
18 
19 
21 // construction/destruction
23 
24 //______________________________________________________________________________
25 FUShmServer::FUShmServer(FUShmBuffer* buffer)
26  : buffer_(buffer)
27 {
28 
29 }
30 
31 
32 //______________________________________________________________________________
34 {
35 
36 }
37 
38 
40 // implementation of member functions
42 
43 //______________________________________________________________________________
44 unsigned int FUShmServer::writeNext(unsigned char *data,
45  unsigned int nFed,
46  unsigned int *fedSize)
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
unsigned int writeNext(unsigned char *data, unsigned int nFed, unsigned int *fedSize)
Definition: FUShmServer.cc:44