Panda3D
membuffer.h
1 #ifndef __MEMBUFFER_GM_H__
2 #define __MEMBUFFER_GM_H__
3 
4 class EXPCL_PANDA_NATIVENET MemBuffer {
5 public:
6  inline MemBuffer(void);
7  inline MemBuffer(size_t len);
8  inline MemBuffer(char * data, size_t len);
9  virtual ~MemBuffer();
10  inline void SetBuffer(char * data, size_t len);
11  inline void GrowBuffer(size_t len);
12  inline size_t GetBufferSize(void ) const;
13  inline char * GetBuffer(void);
14  inline const char * GetBuffer(void) const;
15  inline bool InBufferRange(char * );
16 
17 protected:
18  bool _BufferLocal; // indicates responsibility of managment of the data
19  size_t _BufferLen; // the length of the data
20  char * _Buffer; // the data
21 
22  inline void ClearBuffer(void);
23  inline void AllocBuffer(size_t len);
24 };
25 
26 #include "membuffer.I"
27 
28 #endif //__MEMBUFFER_GM_H__