versadac  1
versadac - Scalable Recorder Firmware
dre_buff.h
1 /*****************************************************************************
2 FILE : dre_buff.h
3 AUTHOR : Dave Storey
4 SYSTEM : GNU C++ for ARM
5 DESCRIPTION : Buffer base class used by DreFile to store copy of UHH records
6 *****************************************************************************/
7 
8 #ifndef DRE_BUFF_H
9 #define DRE_BUFF_H
10 
11 extern "C"
12 {
13  #include "stdtypes.h"
14 }
15 
16 class DreBuffer
17 {
18  public:
19  DreBuffer(uint32 z_uInitSize, uint32 z_uChunkSize);
20  ~DreBuffer();
21 
22  bool equals(DreBuffer *z_pOther);
23  void putByte(uint8 z_uByte);
24 
25  // Inline methods
26  inline void clear() {m_puEnd = m_puBytes;} // NB doesn't free
27  inline uint8 *data() {return m_puBytes;}
28  inline uint32 size() {return m_puEnd - m_puBytes;}
29 
30  private:
31  uint8 *m_puBytes; // Ptr to the data byte array
32  uint8 *m_puEnd; // Ptr to (just beyond) last data byte
33  uint32 m_uAlloc; // Number of bytes currently allocated
34  uint32 m_uChunkSize; // Number of bytes to further allocate when run out of room
35 };
36 
37 #endif
Definition: dre_buff.h:16