BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
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

◆ main()

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

Definition at line 8 of file client.cxx.

9{
10 if ( argc != 3 ) {
11 std::cerr << "Usage: " << argv[0] << " ServerName NEvt" << std::endl;
12 exit(0);
13 }
14
15 uint32_t nTot = (uint32_t)atoi(argv[2]);
16
17 NetDataReader* dreader = new NetDataReader( argv[1] );
18
19 std::cout << "[TestClient] Now we are reading: " << dreader->currentFile() << std::endl;
20
21 for ( uint32_t i = 0; i < nTot; ++i ) {
22 const uint32_t* pevt = 0;
23 try {
24 pevt = (const uint32_t*)dreader->nextEvent();
25 }
26 catch ( RawFileException& e ) {
27 e.print();
28 break;
29 }
30
31 if ( pevt != 0 ) {
32 uint32_t size = pevt[1];
33 uint32_t evt = pevt[8 + pevt[5]];
34 uint32_t run = pevt[9 + pevt[5]];
35
36 std::cout << "Size : " << size << " RID: " << run << " GID: " << evt << std::endl;
37 }
38 else {
39 break;
40 }
41 }
42
43 delete dreader;
44
45 return 0;
46}
PthrReaderBufPool< DimRpcReader, 4 > NetDataReader
Definition: NetDataReader.h:7
std::string currentFile()
const uint32_t * nextEvent()
virtual void print() const