#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[]) |
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 }