YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::Packet Class Reference

#include <Packet.hpp>

Inheritance diagram for yap::Packet:
Collaboration diagram for yap::Packet:

List of all members.

Public Member Functions

 Packet ()
virtual ~Packet ()
void CreateFromType (PacketType type)
bool CreateFromSocket (ClientSocket &socket)
IPacket members.
virtual const PacketTypeGetType () const
virtual sf::Packet & GetInnerPacket ()
IWriter members.
virtual void Accept (IWriterVisitor &visitor)
virtual void Accept (IWriterConstVisitor &visitor) const
virtual void Write (const String &value)
virtual void Write (const String &name, const String &value)
virtual void Write (const bool &value)
virtual void Write (const String &name, const bool &value)
virtual void Write (const char &value)
virtual void Write (const String &name, const char &value)
virtual void Write (const uchar &value)
virtual void Write (const String &name, const uchar &value)
virtual void Write (const Int16 &value)
virtual void Write (const String &name, const Int16 &value)
virtual void Write (const UInt16 &value)
virtual void Write (const String &name, const UInt16 &value)
virtual void Write (const int &value)
virtual void Write (const String &name, const int &value)
virtual void Write (const uint &value)
virtual void Write (const String &name, const uint &value)
virtual void Write (const Int64 &value)
 Not working. Corresponds to Packet::Write (const int&).
virtual void Write (const String &name, const Int64 &value)
virtual void Write (const UInt64 &value)
 Not working. Corresponds to Packet::Write (const uint&).
virtual void Write (const String &name, const UInt64 &value)
virtual void Write (const float &value)
virtual void Write (const String &name, const float &value)
virtual void Write (const double &value)
virtual void Write (const String &name, const double &value)
virtual void Write (const Vector2 &value)
virtual void Write (const String &name, const Vector2 &value)
virtual void Write (const ID &value)
virtual void Write (const String &name, const ID &value)
IReader members.
virtual void Accept (IReaderVisitor &visitor)
virtual void Accept (IReaderConstVisitor &visitor) const
virtual String ReadString ()
virtual String ReadString (const String &name)
virtual bool ReadBool ()
virtual bool ReadBool (const String &name)
virtual char ReadChar ()
virtual char ReadChar (const String &name)
virtual uchar ReadUChar ()
virtual uchar ReadUChar (const String &name)
virtual Int16 ReadInt16 ()
virtual Int16 ReadInt16 (const String &name)
virtual UInt16 ReadUInt16 ()
virtual UInt16 ReadUInt16 (const String &name)
virtual int ReadInt ()
virtual int ReadInt (const String &name)
virtual uint ReadUInt ()
virtual uint ReadUInt (const String &name)
virtual Int64 ReadInt64 ()
 Not working. Corresponds to Packet::ReadInt ().
virtual Int64 ReadInt64 (const String &name)
virtual UInt64 ReadUInt64 ()
 Not working. Corresponds to Packet::ReadUInt ().
virtual UInt64 ReadUInt64 (const String &name)
virtual float ReadFloat ()
virtual float ReadFloat (const String &name)
virtual double ReadDouble ()
virtual double ReadDouble (const String &name)
virtual Vector2 ReadVector2 ()
virtual Vector2 ReadVector2 (const String &name)
virtual ID ReadID ()
virtual ID ReadID (const String &name)
- Public Member Functions inherited from yap::IPacket
virtual ~IPacket ()
- Public Member Functions inherited from yap::IWriter
virtual ~IWriter ()
- Public Member Functions inherited from yap::IReader
virtual ~IReader ()

Private Member Functions

 DISALLOW_COPY (Packet)
void Write (PacketType packetType)
PacketType ReadPacketType ()
template<typename T >
void WriteData (const T &data)
template<typename T >
ReadData ()
template<>
void WriteData (const String &data)

Private Attributes

PacketType type_
sf::Packet packet_

Static Private Attributes

static const PacketType DEFAULT_TYPE = PacketType::None

Detailed Description

Definition at line 13 of file Packet.hpp.


Constructor & Destructor Documentation

yap::Packet::Packet ( )

Definition at line 16 of file Packet.cpp.

yap::Packet::~Packet ( )
virtual

Definition at line 22 of file Packet.cpp.


Member Function Documentation

void yap::Packet::Accept ( IWriterVisitor visitor)
virtual

Implements yap::IWriter.

Definition at line 63 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Accept ( IWriterConstVisitor visitor) const
virtual

Implements yap::IWriter.

Definition at line 68 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Accept ( IReaderVisitor visitor)
virtual

Implements yap::IReader.

Definition at line 73 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Accept ( IReaderConstVisitor visitor) const
virtual

Implements yap::IReader.

Definition at line 78 of file Packet.cpp.

Here is the call graph for this function:

bool yap::Packet::CreateFromSocket ( ClientSocket socket)

Definition at line 33 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::CreateFromType ( PacketType  type)

Definition at line 26 of file Packet.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yap::Packet::DISALLOW_COPY ( Packet  )
private
sf::Packet & yap::Packet::GetInnerPacket ( )
virtual

Implements yap::IPacket.

Definition at line 48 of file Packet.cpp.

const PacketType & yap::Packet::GetType ( ) const
virtual

Implements yap::IPacket.

Definition at line 43 of file Packet.cpp.

bool yap::Packet::ReadBool ( )
virtual

Implements yap::IReader.

Definition at line 234 of file Packet.cpp.

bool yap::Packet::ReadBool ( const String name)
virtual

Implements yap::IReader.

Definition at line 239 of file Packet.cpp.

char yap::Packet::ReadChar ( )
virtual

Implements yap::IReader.

Definition at line 244 of file Packet.cpp.

char yap::Packet::ReadChar ( const String name)
virtual

Implements yap::IReader.

Definition at line 249 of file Packet.cpp.

String yap::Packet::ReadData< String > ( )
inlineprivate

Definition at line 13 of file Packet.hxx.

double yap::Packet::ReadDouble ( )
virtual

Implements yap::IReader.

Definition at line 334 of file Packet.cpp.

double yap::Packet::ReadDouble ( const String name)
virtual

Implements yap::IReader.

Definition at line 339 of file Packet.cpp.

float yap::Packet::ReadFloat ( )
virtual

Implements yap::IReader.

Definition at line 324 of file Packet.cpp.

Here is the caller graph for this function:

float yap::Packet::ReadFloat ( const String name)
virtual

Implements yap::IReader.

Definition at line 329 of file Packet.cpp.

ID yap::Packet::ReadID ( )
virtual

Implements yap::IReader.

Definition at line 357 of file Packet.cpp.

Here is the call graph for this function:

ID yap::Packet::ReadID ( const String name)
virtual

Implements yap::IReader.

Definition at line 362 of file Packet.cpp.

int yap::Packet::ReadInt ( )
virtual

Implements yap::IReader.

Definition at line 284 of file Packet.cpp.

int yap::Packet::ReadInt ( const String name)
virtual

Implements yap::IReader.

Definition at line 289 of file Packet.cpp.

Int16 yap::Packet::ReadInt16 ( )
virtual

Implements yap::IReader.

Definition at line 264 of file Packet.cpp.

Here is the caller graph for this function:

Int16 yap::Packet::ReadInt16 ( const String name)
virtual

Implements yap::IReader.

Definition at line 269 of file Packet.cpp.

Int64 yap::Packet::ReadInt64 ( )
virtual

Not working. Corresponds to Packet::ReadInt ().

Implements yap::IReader.

Definition at line 304 of file Packet.cpp.

Int64 yap::Packet::ReadInt64 ( const String name)
virtual

Implements yap::IReader.

Definition at line 309 of file Packet.cpp.

PacketType yap::Packet::ReadPacketType ( )
private

Definition at line 58 of file Packet.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

String yap::Packet::ReadString ( )
virtual

Implements yap::IReader.

Definition at line 224 of file Packet.cpp.

String yap::Packet::ReadString ( const String name)
virtual

Implements yap::IReader.

Definition at line 229 of file Packet.cpp.

uchar yap::Packet::ReadUChar ( )
virtual

Implements yap::IReader.

Definition at line 254 of file Packet.cpp.

uchar yap::Packet::ReadUChar ( const String name)
virtual

Implements yap::IReader.

Definition at line 259 of file Packet.cpp.

uint yap::Packet::ReadUInt ( )
virtual

Implements yap::IReader.

Definition at line 294 of file Packet.cpp.

uint yap::Packet::ReadUInt ( const String name)
virtual

Implements yap::IReader.

Definition at line 299 of file Packet.cpp.

UInt16 yap::Packet::ReadUInt16 ( )
virtual

Implements yap::IReader.

Definition at line 274 of file Packet.cpp.

UInt16 yap::Packet::ReadUInt16 ( const String name)
virtual

Implements yap::IReader.

Definition at line 279 of file Packet.cpp.

UInt64 yap::Packet::ReadUInt64 ( )
virtual

Not working. Corresponds to Packet::ReadUInt ().

Implements yap::IReader.

Definition at line 314 of file Packet.cpp.

Here is the caller graph for this function:

UInt64 yap::Packet::ReadUInt64 ( const String name)
virtual

Implements yap::IReader.

Definition at line 319 of file Packet.cpp.

Vector2 yap::Packet::ReadVector2 ( )
virtual

Implements yap::IReader.

Definition at line 344 of file Packet.cpp.

Here is the call graph for this function:

Vector2 yap::Packet::ReadVector2 ( const String name)
virtual

Implements yap::IReader.

Definition at line 352 of file Packet.cpp.

void yap::Packet::Write ( const String value)
virtual

Implements yap::IWriter.

Definition at line 83 of file Packet.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Packet::Write ( const String name,
const String value 
)
virtual

Implements yap::IWriter.

Definition at line 88 of file Packet.cpp.

void yap::Packet::Write ( const bool &  value)
virtual

Implements yap::IWriter.

Definition at line 93 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const bool &  value 
)
virtual

Implements yap::IWriter.

Definition at line 98 of file Packet.cpp.

void yap::Packet::Write ( const char &  value)
virtual

Implements yap::IWriter.

Definition at line 103 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const char &  value 
)
virtual

Implements yap::IWriter.

Definition at line 108 of file Packet.cpp.

void yap::Packet::Write ( const uchar value)
virtual

Implements yap::IWriter.

Definition at line 113 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const uchar value 
)
virtual

Implements yap::IWriter.

Definition at line 118 of file Packet.cpp.

void yap::Packet::Write ( const Int16 value)
virtual

Implements yap::IWriter.

Definition at line 123 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const Int16 value 
)
virtual

Implements yap::IWriter.

Definition at line 128 of file Packet.cpp.

void yap::Packet::Write ( const UInt16 value)
virtual

Implements yap::IWriter.

Definition at line 133 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const UInt16 value 
)
virtual

Implements yap::IWriter.

Definition at line 138 of file Packet.cpp.

void yap::Packet::Write ( const int &  value)
virtual

Implements yap::IWriter.

Definition at line 143 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const int &  value 
)
virtual

Implements yap::IWriter.

Definition at line 148 of file Packet.cpp.

void yap::Packet::Write ( const uint value)
virtual

Implements yap::IWriter.

Definition at line 153 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const uint value 
)
virtual

Implements yap::IWriter.

Definition at line 158 of file Packet.cpp.

void yap::Packet::Write ( const Int64 value)
virtual

Not working. Corresponds to Packet::Write (const int&).

Implements yap::IWriter.

Definition at line 163 of file Packet.cpp.

void yap::Packet::Write ( const String name,
const Int64 value 
)
virtual

Implements yap::IWriter.

Definition at line 168 of file Packet.cpp.

void yap::Packet::Write ( const UInt64 value)
virtual

Not working. Corresponds to Packet::Write (const uint&).

Implements yap::IWriter.

Definition at line 173 of file Packet.cpp.

void yap::Packet::Write ( const String name,
const UInt64 value 
)
virtual

Implements yap::IWriter.

Definition at line 178 of file Packet.cpp.

void yap::Packet::Write ( const float &  value)
virtual

Implements yap::IWriter.

Definition at line 183 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const float &  value 
)
virtual

Implements yap::IWriter.

Definition at line 188 of file Packet.cpp.

void yap::Packet::Write ( const double &  value)
virtual

Implements yap::IWriter.

Definition at line 193 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const double &  value 
)
virtual

Implements yap::IWriter.

Definition at line 198 of file Packet.cpp.

void yap::Packet::Write ( const Vector2 value)
virtual

Implements yap::IWriter.

Definition at line 203 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const Vector2 value 
)
virtual

Implements yap::IWriter.

Definition at line 209 of file Packet.cpp.

void yap::Packet::Write ( const ID value)
virtual

Implements yap::IWriter.

Definition at line 214 of file Packet.cpp.

Here is the call graph for this function:

void yap::Packet::Write ( const String name,
const ID value 
)
virtual

Implements yap::IWriter.

Definition at line 219 of file Packet.cpp.

void yap::Packet::Write ( PacketType  packetType)
private

Definition at line 53 of file Packet.cpp.

Here is the call graph for this function:

template<>
void yap::Packet::WriteData ( const String data)
inlineprivate

Definition at line 21 of file Packet.hxx.

template<typename T >
void yap::Packet::WriteData ( const T &  data)
inlineprivate

Definition at line 7 of file Packet.hxx.

Here is the caller graph for this function:


Member Data Documentation

const PacketType yap::Packet::DEFAULT_TYPE = PacketType::None
staticprivate

Definition at line 147 of file Packet.hpp.

sf::Packet yap::Packet::packet_
private

Definition at line 150 of file Packet.hpp.

PacketType yap::Packet::type_
private

Definition at line 149 of file Packet.hpp.


The documentation for this class was generated from the following files: