Want more features on Pastebin? Sign Up, it's FREE!
Guest

yuriks

By: a guest on Dec 2nd, 2008  |  syntax: C++  |  size: 0.56 KB  |  views: 652  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Packet.h
  2.  
  3. class Packet
  4. {
  5. private:
  6.         Packet& operator=(const Packet&);
  7. public:
  8.         struct PacketInitException : std::runtime_error
  9.         {
  10.                 PacketInitException(const std::string& msg) : runtime_error(msg)
  11.                 {}
  12.         };
  13.  
  14.         Packet();
  15.         virtual ~Packet();
  16.  
  17.         virtual Packet* clone() const = 0;
  18.  
  19.         virtual void handle() = 0;
  20.         virtual PacketFactory::PacketIds getId() const = 0;
  21.  
  22.         virtual void serialize(Uint8 *data) const;
  23.         static Packet* createPacket(Uint8 *data);
  24.         virtual void deserialize(Uint8 *data);
  25.         virtual int getPacketSize() const;
  26.  
  27.  
  28.         Uint16 packetId;
  29. };
clone this paste RAW Paste Data