| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RawBuffer.h

Go to the documentation of this file.
00001 /* Raw Buffer: Class for handling an arbitrary binary buffer
00002  *
00003  * Created By: dandwyer@caltech.edu 2009/7/10
00004  */
00005 
00006 #ifndef RAWBUFFER_H
00007 #define RAWBUFFER_H
00008 
00009 namespace DayaBay {
00010 
00011   // Raw buffer
00012   class RawBuffer {
00013     public:
00014       RawBuffer();
00015       RawBuffer(unsigned int* buffer, bool isOwner=false, 
00016                 unsigned int bufferSize=0);
00017       RawBuffer(DayaBay::RawBuffer& buffer, bool adopt=false);
00018       virtual ~RawBuffer();
00019       unsigned int* buffer() const;     // Pointer to start of raw data block
00020       unsigned int  bufferSize() const; // Size of the memory buffer, if known
00021       bool          isOwner() const;    // Does this buffer own the memory?
00022       void          setOwner(bool isOwner=true); // Set this buffer as owner
00023       virtual bool  isValid() const;    // Buffer contains valid data?
00024       // Read binary data from block
00025       unsigned int* getPointer(const unsigned int& line) const;
00026       unsigned int  getValue(const unsigned int& line,
00027                              const unsigned int& firstBit=0, 
00028                              const unsigned int& bitLength=32) const;
00029       char*         getString(const unsigned int& line,
00030                               const unsigned int& byteOffset=0) const;
00031     private:
00032       unsigned int*   m_buffer;  // Buffer of raw data block
00033       unsigned int    m_bufferSize;  // Size of buffer
00034       bool            m_isOwner; // Own the buffer, and free memory on delete?
00035   };
00036 
00037 }
00038 
00039 #endif // RAWBUFFER_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:07:27 2011 for RawData by doxygen 1.4.7