File indexing completed on 2025-08-03 08:20:53
0001
0002 #ifndef __RCDAQEVENTITERATOR_H__
0003 #define __RCDAQEVENTITERATOR_H__
0004
0005 #include "Eventiterator.h"
0006 #include "buffer.h"
0007
0008 #ifndef __CINT__
0009 #include <string>
0010
0011 #include <arpa/inet.h>
0012 #include <stdio.h>
0013
0014 #endif
0015
0016
0017 #ifndef __CINT__
0018 class WINDOWSEXPORT rcdaqEventiterator : public Eventiterator {
0019 #else
0020 class rcdaqEventiterator : public Eventiterator {
0021 #endif
0022 public:
0023
0024 virtual ~rcdaqEventiterator();
0025 rcdaqEventiterator();
0026 rcdaqEventiterator(const char *ip );
0027 rcdaqEventiterator(const char *ip, int &status);
0028
0029 const char * getIdTag() const;
0030 virtual void identify(std::ostream& os = std::cout) const;
0031
0032
0033 Event *getNextEvent();
0034
0035 protected:
0036 int read_next_buffer();
0037
0038 int setup(const char *ip, int &status);
0039
0040 int readn (int fd, char *ptr, int nbytes);
0041 int writen (int fd, char *ptr, int nbytes);
0042
0043
0044 std::string _theIP;
0045 int _serverid;
0046
0047 int _sockfd;
0048 PHDWORD initialbuffer[BUFFERSIZE];
0049 PHDWORD *bp;
0050 int allocatedsize;
0051
0052 int current_index;
0053 int last_read_status;
0054 int buffer_size;
0055 buffer *bptr;
0056 struct sockaddr_in server;
0057 int _defunct;
0058
0059 };
0060
0061 #endif
0062