/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/DistBoss/NetDataReader/NetDataReader-00-00-06/test/client.cxx File Reference

#include "NetDataReader/NetDataReader.h"
#include "IRawFile/RawFileExceptions.h"
#include <string>
#include <iostream>
#include <stdlib.h>
#include <stdint.h>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 8 of file client.cxx.

References PthrReaderBufPool< Reader, PoolSize >::currentFile(), genRecEmupikp::i, PthrReaderBufPool< Reader, PoolSize >::nextEvent(), RawFileException::print(), and delete_small_size::size.

00009 {
00010    if ( argc != 3 ) {
00011       std::cerr << "Usage: " << argv[0] << " ServerName NEvt" << std::endl;
00012       exit(0);
00013    }
00014 
00015    uint32_t nTot = (uint32_t)atoi(argv[2]);
00016 
00017    NetDataReader* dreader = new NetDataReader( argv[1] );
00018 
00019    std::cout << "[TestClient] Now we are reading: " << dreader->currentFile() << std::endl;
00020 
00021    for ( uint32_t i = 0; i < nTot; ++i ) {
00022       const uint32_t* pevt = 0;
00023       try {
00024          pevt = (const uint32_t*)dreader->nextEvent();
00025       }
00026       catch ( RawFileException& e ) {
00027          e.print();
00028          break;
00029       }
00030 
00031       if ( pevt != 0 ) {
00032          uint32_t size = pevt[1];
00033          uint32_t evt  = pevt[8 + pevt[5]];
00034          uint32_t run  = pevt[9 + pevt[5]];
00035 
00036          std::cout << "Size : " << size << "  RID: " << run << "  GID: " << evt << std::endl;
00037       }
00038       else {
00039          break;
00040       }
00041    }
00042 
00043    delete dreader;
00044 
00045    return 0;
00046 }


Generated on Tue Nov 29 23:14:56 2016 for BOSS_7.0.2 by  doxygen 1.4.7