EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rcdaqEventiterator.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file rcdaqEventiterator.h
1 // -*- c++ -*-
2 #ifndef __RCDAQEVENTITERATOR_H__
3 #define __RCDAQEVENTITERATOR_H__
4 
5 #include "Eventiterator.h"
6 #include "buffer.h"
7 
8 #ifndef __CINT__
9 #include <string>
10 
11 #include <arpa/inet.h>
12 #include <stdio.h>
13 
14 #endif
15 
16 
17 #ifndef __CINT__
19 #else
20 class rcdaqEventiterator : public Eventiterator {
21 #endif
22 public:
23 
24  virtual ~rcdaqEventiterator();
26  rcdaqEventiterator(const char *ip );
27  rcdaqEventiterator(const char *ip, int &status);
28 
29  const char * getIdTag() const;
30  virtual void identify(std::ostream& os = std::cout) const;
31 
32 
33  Event *getNextEvent();
34 
35 protected:
36  int read_next_buffer();
37 
38  int setup(const char *ip, int &status);
39 
40  int readn (int fd, char *ptr, int nbytes);
41  int writen (int fd, char *ptr, int nbytes);
42 
43 
44  std::string _theIP;
45 
46  int _sockfd;
47  PHDWORD initialbuffer[BUFFERSIZE];
50 
55  struct sockaddr_in server;
56  int _defunct;
57 
58 };
59 
60 #endif /* __RCDAQEVENTITERATOR_H__ */
61