Pol  Revision:cb584c9
packetscrobj.h
Go to the documentation of this file.
1 
8 #ifndef PACKETSCROBJ_H
9 #define PACKETSCROBJ_H
10 
11 
12 #ifndef BSCRIPT_BOBJECT_H
13 #include "../bscript/bobject.h"
14 #endif
15 
16 #include <string>
17 
18 #include "../clib/compilerspecifics.h"
19 #include "../clib/rawtypes.h"
20 
21 namespace Pol
22 {
23 namespace Bscript
24 {
25 class Executor;
26 } // namespace Bscript
27 } // namespace Pol
28 
29 namespace Pol
30 {
31 namespace Core
32 {
34 {
35 public:
36  BPacket();
37  BPacket( const BPacket& copyfrom );
38  BPacket( u8 type, signed short length );
39  BPacket( const unsigned char* data, unsigned short length, bool variable_len );
40  ~BPacket();
41 
42  std::vector<unsigned char> buffer;
43  virtual Bscript::BObjectRef get_member( const char* membername ) POL_OVERRIDE;
44  virtual Bscript::BObjectRef get_member_id( const int id ) POL_OVERRIDE; // id test
45  virtual Bscript::BObjectImp* call_method( const char* methodname,
47  virtual Bscript::BObjectImp* call_method_id( const int id, Bscript::Executor& ex,
48  bool forcebuiltin = false ) POL_OVERRIDE;
49  virtual Bscript::BObjectImp* copy() const POL_OVERRIDE;
50  virtual std::string getStringRep() const POL_OVERRIDE;
51  bool SetSize( u16 newsize );
52  Bscript::BObjectImp* SetSize( u16 newsize, bool giveReturn );
53  virtual size_t sizeEstimate() const POL_OVERRIDE
54  {
55  return sizeof( *this ) + 3 * sizeof( void* ) * buffer.capacity() * sizeof( unsigned char );
56  }
57  virtual const char* typeOf() const POL_OVERRIDE { return "Packet"; }
58  virtual u8 typeOfInt() const POL_OVERRIDE { return OTPacket; }
60 };
61 }
62 }
63 #endif
unsigned char u8
Definition: rawtypes.h:25
std::vector< unsigned char > buffer
Definition: packetscrobj.h:42
#define POL_OVERRIDE
STL namespace.
virtual const char * typeOf() const POL_OVERRIDE
Definition: packetscrobj.h:57
unsigned short u16
Definition: rawtypes.h:26
virtual u8 typeOfInt() const POL_OVERRIDE
Definition: packetscrobj.h:58
std::unordered_map< u64, ScriptDiffData > data
Definition: osmod.cpp:966
Definition: berror.cpp:12