TPProto::Frame Class Reference

Frame baseclass. More...

#include <frame.h>

Inheritance diagram for TPProto::Frame:

TPProto::AccountCreate TPProto::AddCategory TPProto::AddDesign TPProto::Board TPProto::Category TPProto::Command TPProto::CommandDescription TPProto::CommandResult TPProto::Component TPProto::Connect TPProto::Design TPProto::FailFrame TPProto::Features TPProto::FinishedFrame TPProto::GameInfo TPProto::GetById TPProto::GetFeatures TPProto::GetGameInfo TPProto::GetIdSequence TPProto::GetMessage TPProto::GetObjectByPos TPProto::GetObjectIdsByContainer TPProto::GetObjectIdsByPos TPProto::GetOrder TPProto::GetTime TPProto::IdSequence TPProto::Login TPProto::LogMessage TPProto::Message TPProto::ModifyDesign TPProto::Object TPProto::ObjectDescription TPProto::OkFrame TPProto::Order TPProto::OrderDescription TPProto::Ping TPProto::Player TPProto::ProbeOrder TPProto::Property TPProto::Redirect TPProto::RemoveCategory TPProto::RemoveDesign TPProto::RemoveMessage TPProto::RemoveOrder TPProto::ResourceDescription TPProto::Sequence TPProto::SetFilters TPProto::TimeRemaining List of all members.

Public Member Functions

virtual ~Frame ()
 Standard virtual default destructor.
virtual void packBuffer (Buffer *buf)=0
 Virtual method for packing this Frame into a Buffer.
virtual bool unpackBuffer (Buffer *buf)=0
 Virtual method for unpacking this Frame from a Buffer.
void setProtocolVersion (int ver)
 Sets the protocol version number.
int getProtocolVersion ()
 Gets the protocol version number.
void setSequenceNumber (unsigned int seq)
 Sets the sequence number to use.
unsigned int getSequenceNumber ()
 Gets the sequence number used.
int getType ()
 Gets the type number for this frame.

Protected Attributes

int protoVer
 The protocol version.
int seqnum
 The sequence number.
int type
 The type of this Frame.

Detailed Description

Frame baseclass.

Frame is the basic message sent to and from the server. It stores the current protocol version number, the sequence number of the frame and the type.


Member Function Documentation

virtual void TPProto::Frame::packBuffer ( Buffer buf  )  [pure virtual]

Virtual method for packing this Frame into a Buffer.

This method must be overridden by all subclasses. Some subclasses may make a call to assert(0) if they should not be sent to the server.

Parameters:
buf The Buffer to pack into.

Implemented in TPProto::AddCategory, TPProto::AddDesign, TPProto::Board, TPProto::Category, TPProto::Command, TPProto::CommandDescription, TPProto::CommandResult, TPProto::Component, TPProto::Connect, TPProto::AccountCreate, TPProto::Design, TPProto::FailFrame, TPProto::Features, TPProto::FinishedFrame, TPProto::GameInfo, TPProto::GetBoardIdsList, TPProto::GetById, TPProto::GetCategoryIdsList, TPProto::GetCommandTypesList, TPProto::GetComponentIdsList, TPProto::GetDesignIdsList, TPProto::GetFeatures, TPProto::GetGameInfo, TPProto::GetIdSequence, TPProto::GetMessage, TPProto::GetObjectByPos, TPProto::GetObjectIdsByContainer, TPProto::GetObjectIdsByPos, TPProto::GetObjectIdsList, TPProto::GetObjectTypesList, TPProto::GetOrder, TPProto::GetOrderTypesList, TPProto::GetPropertyIdsList, TPProto::GetResourceTypesList, TPProto::GetTime, TPProto::IdSequence, TPProto::Login, TPProto::LogMessage, TPProto::Message, TPProto::ModifyDesign, TPProto::Object, TPProto::ObjectDescription, TPProto::OkFrame, TPProto::Order, TPProto::OrderDescription, TPProto::Ping, TPProto::Player, TPProto::ProbeOrder, TPProto::Property, TPProto::Redirect, TPProto::RemoveCategory, TPProto::RemoveDesign, TPProto::RemoveMessage, TPProto::RemoveOrder, TPProto::ResourceDescription, TPProto::Sequence, TPProto::SetFilters, and TPProto::TimeRemaining.

virtual bool TPProto::Frame::unpackBuffer ( Buffer buf  )  [pure virtual]

Virtual method for unpacking this Frame from a Buffer.

This method must be overridden by all subclasses. Some subclasses may always return false if they should never be received from the server.

Parameters:
buf The Buffer to unpack out of.
Returns:
True if successfully unpacked, false otherwise.

Implemented in TPProto::AddCategory, TPProto::AddDesign, TPProto::Board, TPProto::BoardIdsList, TPProto::Category, TPProto::CategoryIdsList, TPProto::Command, TPProto::CommandDescription, TPProto::CommandResult, TPProto::CommandTypesList, TPProto::Component, TPProto::ComponentIdsList, TPProto::Connect, TPProto::AccountCreate, TPProto::Design, TPProto::DesignIdsList, TPProto::FailFrame, TPProto::Features, TPProto::FinishedFrame, TPProto::Fleet, TPProto::GameInfo, TPProto::GetById, TPProto::GetFeatures, TPProto::GetGameInfo, TPProto::GetIdSequence, TPProto::GetMessage, TPProto::GetObjectByPos, TPProto::GetObjectIdsByContainer, TPProto::GetObjectIdsByPos, TPProto::GetOrder, TPProto::GetTime, TPProto::IdSequence, TPProto::Login, TPProto::LogMessage, TPProto::Message, TPProto::ModifyDesign, TPProto::Object, TPProto::ObjectDescription, TPProto::ObjectIdsList, TPProto::ObjectTypesList, TPProto::OkFrame, TPProto::Order, TPProto::OrderDescription, TPProto::OrderTypesList, TPProto::Ping, TPProto::Planet, TPProto::Player, TPProto::ProbeOrder, TPProto::Property, TPProto::PropertyIdsList, TPProto::Redirect, TPProto::RemoveCategory, TPProto::RemoveDesign, TPProto::RemoveMessage, TPProto::RemoveOrder, TPProto::ResourceDescription, TPProto::ResourceTypesList, TPProto::Sequence, TPProto::SetFilters, TPProto::TimeRemaining, and TPProto::Universe.

void TPProto::Frame::setProtocolVersion ( int  ver  ) 

Sets the protocol version number.

Parameters:
ver The version number to use.

int TPProto::Frame::getProtocolVersion (  ) 

Gets the protocol version number.

Returns:
The version number.

void TPProto::Frame::setSequenceNumber ( unsigned int  seq  ) 

Sets the sequence number to use.

Parameters:
seq The sequence number.

unsigned int TPProto::Frame::getSequenceNumber (  ) 

Gets the sequence number used.

Returns:
The sequence number.

int TPProto::Frame::getType (  ) 

Gets the type number for this frame.

This value should be in the FrameType enum.

Returns:
The type of this frame.


Member Data Documentation

int TPProto::Frame::type [protected]

The type of this Frame.

Should always be in the FrameType enum.


The documentation for this class was generated from the following files:
Generated on Tue Jan 6 07:30:46 2009 for libtpproto-cpp by  doxygen 1.5.1