25 bool segmentationMode=
false;
26 unsigned int nCells =32;
27 unsigned int nFed = 4;
28 unsigned int bytesPerFed =10;
29 unsigned int cellBufferSize =nFed*bytesPerFed;
31 if (argc>1) { stringstream ss; ss<<argv[1]; ss>>segmentationMode; }
33 cout<<
" FUShmServer_t:"
34 <<
" segmentationMode="<<segmentationMode
37 <<
" bytesPerFed="<<bytesPerFed
38 <<
" cellBufferSize="<<cellBufferSize<<endl<<endl;
40 FUShmBuffer* buffer=FUShmBuffer::createShmBuffer(segmentationMode,
43 if (0==buffer)
return 1;
48 unsigned char*
data =
new unsigned char[cellBufferSize];
49 unsigned int* fedSize =
new unsigned int[nFed];
50 for (
unsigned int i=0;
i<nFed;
i++) fedSize[
i]=bytesPerFed;
57 for (
unsigned int i=0;
i<cellBufferSize;
i++) {
58 unsigned int rnd=
rand();
59 double tmp=rnd/(double)RAND_MAX*255;
60 rnd=(
unsigned int)tmp;
61 data[
i]=(
unsigned char)rnd;
64 unsigned int iCell=server->
writeNext(data,nFed,fedSize);
65 cout<<
"WROTE at index "<<iCell<<endl;
int main(int argc, char **argv)
std::vector< std::vector< double > > tmp
char data[epos_bytes_allocation]
unsigned int writeNext(unsigned char *data, unsigned int nFed, unsigned int *fedSize)