TPProto::Order Class Reference

A Frame representing an Order on an Object. More...

#include <order.h>

Inheritance diagram for TPProto::Order:

TPProto::Frame List of all members.

Public Member Functions

 Order ()
 Default constructor.
virtual ~Order ()
 Destructor.
void packBuffer (Buffer *buf)
 Pack this Order Frame into a Buffer.
bool unpackBuffer (Buffer *buf)
 Unpack this Order from a Buffer.
std::string getName ()
 Gets the name of this order type.
std::string getDescription ()
 Gets the text description of this order type.
unsigned int getOrderType ()
 Gets the order type number of this order.
unsigned int getObjectId ()
 Gets the Object id this order is on.
int getSlot ()
 Gets the slot number for this order.
unsigned int getNumTurns ()
 Gets the number of turns until this order is completed.
unsigned int getNumParameters ()
 Gets the number of OrderParameters this order has.
OrderParametergetParameter (unsigned int which)
 Gets an OrderParameter.
void setObjectId (unsigned int oid)
 Sets the Object id this order will be on.
void setSlot (int s)
 Sets the slot number the order will be placed.
void setOrderType (boost::shared_ptr< OrderDescription > od)
 Sets the order type using an OrderDescription.

Detailed Description

A Frame representing an Order on an Object.


Constructor & Destructor Documentation

TPProto::Order::~Order (  )  [virtual]

Destructor.

Deletes the OrderParameters it contains.


Member Function Documentation

void TPProto::Order::packBuffer ( Buffer buf  )  [virtual]

Pack this Order Frame into a Buffer.

Parameters:
buf The Buffer to pack into.

Implements TPProto::Frame.

bool TPProto::Order::unpackBuffer ( Buffer buf  )  [virtual]

Unpack this Order from a Buffer.

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

Implements TPProto::Frame.

std::string TPProto::Order::getName (  ) 

Gets the name of this order type.

Returns:
The name of the order.

std::string TPProto::Order::getDescription (  ) 

Gets the text description of this order type.

Returns:
The text description of the order.

unsigned int TPProto::Order::getOrderType (  ) 

Gets the order type number of this order.

Returns:
The order type number.

unsigned int TPProto::Order::getObjectId (  ) 

Gets the Object id this order is on.

Returns:
The object id.

int TPProto::Order::getSlot (  ) 

Gets the slot number for this order.

Range starts at 0. -1 means the last slot.

Returns:
The slot number.

unsigned int TPProto::Order::getNumTurns (  ) 

Gets the number of turns until this order is completed.

Returns:
The number of turns before completion.

unsigned int TPProto::Order::getNumParameters (  ) 

Gets the number of OrderParameters this order has.

Returns:
The number of parameters.

OrderParameter * TPProto::Order::getParameter ( unsigned int  which  ) 

Gets an OrderParameter.

Parameters:
which The number of the parameter to get.
Returns:
The which-th OrderParameter on this order or NULL if which is not valid.

void TPProto::Order::setObjectId ( unsigned int  oid  ) 

Sets the Object id this order will be on.

Parameters:
oid The object id.

void TPProto::Order::setSlot ( int  s  ) 

Sets the slot number the order will be placed.

Starts from 0. -1 is the last slot.

Parameters:
s The slot number.

void TPProto::Order::setOrderType ( boost::shared_ptr< OrderDescription od  ) 

Sets the order type using an OrderDescription.

Parameters:
od The OrderDescription describing the order type required.


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