Panda3D
physxMemoryReadBuffer.h
1 // Filename: physxMemoryReadBuffer.h
2 // Created by: enn0x (11Oct09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXMEMORYREADBUFFER_H
16 #define PHYSXMEMORYREADBUFFER_H
17 
18 #include "pandabase.h"
19 
20 #include "physx_includes.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : PhysxMemoryReadBuffer
24 // Description :
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_PANDAPHYSX PhysxMemoryReadBuffer : public NxStream {
27 
28 public:
29  PhysxMemoryReadBuffer(const NxU8 *data);
30  virtual ~PhysxMemoryReadBuffer();
31 
32  virtual NxU8 readByte() const;
33  virtual NxU16 readWord() const;
34  virtual NxU32 readDword() const;
35  virtual float readFloat() const;
36  virtual double readDouble() const;
37  virtual void readBuffer(void *buffer, NxU32 size) const;
38 
39  virtual NxStream &storeByte(NxU8 b) { NX_ASSERT(0); return *this; }
40  virtual NxStream &storeWord(NxU16 w) { NX_ASSERT(0); return *this; }
41  virtual NxStream &storeDword(NxU32 d) { NX_ASSERT(0); return *this; }
42  virtual NxStream &storeFloat(NxReal f) { NX_ASSERT(0); return *this; }
43  virtual NxStream &storeDouble(NxF64 f) { NX_ASSERT(0); return *this; }
44  virtual NxStream &storeBuffer(const void *buffer, NxU32 size) { NX_ASSERT(0); return *this; }
45 
46  mutable const NxU8 *buffer;
47 };
48 
49 #endif // PHYSXMEMORYREADBUFFER_H