Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:50

0001 #ifndef __OSPBUFFER_H__
0002 #define __OSPBUFFER_H__
0003 
0004 #include "oBuffer.h"
0005 #include "ospEvent.h"
0006 
0007 
0008 class  ospBuffer : public oBuffer {
0009 
0010 public:
0011 
0012   //** Constructors
0013 
0014   ospBuffer() {};
0015   
0016   ospBuffer (const char *filename, PHDWORD * where,
0017          const int length,
0018          int &status,
0019          const int irun,
0020          const int iseq);
0021   
0022   ospBuffer (int fdin, PHDWORD * where, 
0023          const int length,
0024          const int irun=1, 
0025          const int iseq=0 );
0026 
0027    ~ospBuffer();
0028 
0029   int nextEvent( const unsigned int evtsize, const int etype, const int evtseq);
0030 
0031   int addRawEvent(unsigned int *);
0032 
0033   int addEvent(Event *);
0034 
0035   int addFrame(PHDWORD *) { return 0;};
0036 
0037   int  addPacket( const Packet *p);
0038 
0039   int addUnstructPacketData(PHDWORD * data, 
0040                     const int length,
0041                     const int id,
0042                     const int wordsize,
0043                     const int hitformat);
0044 
0045   int writeout ();
0046 
0047   // now the re-sizing of buffer
0048   int setMaxSize( const int size);
0049 
0050   // and the query
0051   int getMaxSize() const;
0052 
0053   // and the query`
0054   unsigned long long getBytesWritten() const;
0055 
0056   int addEoB();
0057 
0058 
0059 
0060 protected:
0061 
0062   int _broken;
0063   int prepare_next();
0064 
0065 
0066   buffer_ptr bptr;
0067   buffer_ptr bptr_being_written;
0068 
0069   buffer_ptr bptr0;
0070   buffer_ptr bptr1;
0071   PHDWORD *data_ptr;
0072   int current_index;
0073   int max_length;
0074   int max_size;
0075   unsigned int left;
0076   int sequence;
0077   int runnumber;
0078   unsigned long long byteswritten;
0079   ospEvent *current_event;
0080   int eventsequence;
0081   int current_etype;
0082   int has_end;
0083   int dirty;
0084   int fd;
0085   int our_fd;
0086   int good_object;
0087 
0088 
0089 };
0090 
0091 
0092 
0093 #endif /* __OSPBUFFER_H__ */
0094