GNE  0.75.0
GNE::ObjectBrokerPacket Class Reference

The three ObjectBrokerPackets are all identical except for their packet IDs. More...

#include <ObjectBrokerPacket.h>

Inheritance diagram for GNE::ObjectBrokerPacket:
GNE::WrapperPacket GNE::Packet GNE::ObjectCreationPacket GNE::ObjectDeathPacket GNE::ObjectUpdatePacket

Public Types

typedef SmartPtr
< ObjectBrokerPacket
sptr
typedef WeakPtr
< ObjectBrokerPacket
wptr
- Public Types inherited from GNE::WrapperPacket
typedef SmartPtr< WrapperPacketsptr
typedef WeakPtr< WrapperPacketwptr
- Public Types inherited from GNE::Packet
typedef SmartPtr< Packetsptr
typedef WeakPtr< Packetwptr

Public Member Functions

 ObjectBrokerPacket (int packetId, int objectId, const Packet *data)
 Initializes a new ObjectBrokerPacket.
 ObjectBrokerPacket (const ObjectBrokerPacket &o)
 Initializes a new ObjectBrokerPacket from the given one.
int getObjectId () const
 Returns the object ID.
void setObjectId (int newId)
 Sets the object ID for this packet.
virtual int getSize () const
 Returns the current size of this packet in bytes.
virtual void writePacket (Buffer &raw) const
 Writes the packet to the given Buffer.
virtual void readPacket (Buffer &raw)
 Reads this packet from the given Buffer.
- Public Member Functions inherited from GNE::WrapperPacket
const PacketgetData () const
 Returns the encapsulated data in this WrapperPacket.
PacketgetData ()
 Returns the encapsulated data in this WrapperPacket.
void setData (const Packet *packet)
 Replaces the given packet with the current packet as this WrapperPacket's data.
WrapperPacketoperator= (const WrapperPacket &rhs)
 Copies the given WrapperPacket into this one.
- Public Member Functions inherited from GNE::Packet
PacketmakeClone () const
 Returns a newly allocated exact copy of this packet, using the PacketParser::clonePacket function.
int getType () const
 Returns the type of this instance.

Protected Member Functions

 ObjectBrokerPacket (int id)
 This ctor is suitable for use only in the create method.
- Protected Member Functions inherited from GNE::WrapperPacket
 WrapperPacket (int id)
 Initializes a new WrapperPacket with the given Packet ID and no encapsulated Packet.
 WrapperPacket (int id, const Packet *packet)
 Initializes a new WrapperPacket with the given Packet ID and encapsulated Packet.
 WrapperPacket (const WrapperPacket &o)
 Initializes this WrapperPacket with the given WrapperPacket.
- Protected Member Functions inherited from GNE::Packet
 Packet (int id)
 Constructs a packet with the given ID.
 Packet (const Packet &o)
 Copy constructor.
Packetoperator= (const Packet &rhs)
 Copy operator you can use to help you in creating your own.

Detailed Description

The three ObjectBrokerPackets are all identical except for their packet IDs.

This base class abstracts the common functionality.

Constructor & Destructor Documentation

GNE::ObjectBrokerPacket::ObjectBrokerPacket ( int  packetId,
int  objectId,
const Packet data 
)

Initializes a new ObjectBrokerPacket.

The given Packet is copied, if it not NULL. ObjectCreationPacket and ObjectUpdatePacket require a passed packet, but ObjectDeathPacket does not.

Member Function Documentation

void GNE::ObjectBrokerPacket::setObjectId ( int  newId)

Sets the object ID for this packet.

Parameters
thenew ID, in the range of [0..65535] (inclusive).

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