BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
client.cxx
Go to the documentation of this file.
3#include <string>
4#include <iostream>
5#include <stdlib.h>
6#include <stdint.h>
7
8int main(int argc, char* argv[])
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
int main()
Definition: test_IFile.cxx:11