VOX
A little voxel engine
Loading...
Searching...
No Matches
PacketFactory Class Reference

#include <PacketFactory.hpp>

Collaboration diagram for PacketFactory:
Collaboration graph

Public Member Functions

 ~PacketFactory ()
 
 PacketFactory (const PacketFactory &other)=delete
 
PacketFactoryoperator= (const PacketFactory &other)=delete
 
 PacketFactory (PacketFactory &&other)=delete
 
PacketFactoryoperator= (PacketFactory &&other)=delete
 
std::pair< bool, std::shared_ptr< IPacket > > extractPacket (Connection &connection)
 Will try to extract a packet from the connection's buffer. More...
 

Static Public Member Functions

static PacketFactoryGetInstance ()
 Get a ref to the singleton instance of the PacketFactory. More...
 

Constructor & Destructor Documentation

◆ ~PacketFactory()

PacketFactory::~PacketFactory ( )

◆ PacketFactory() [1/2]

PacketFactory::PacketFactory ( const PacketFactory other)
delete

◆ PacketFactory() [2/2]

PacketFactory::PacketFactory ( PacketFactory &&  other)
delete

Member Function Documentation

◆ extractPacket()

std::pair< bool, std::shared_ptr< IPacket > > PacketFactory::extractPacket ( Connection connection)

Will try to extract a packet from the connection's buffer.

Parameters
connection
Returns
a pair containing a bool indicating if the extraction was sucessful and a shared pointer to the packet

calls getPacketInfo to get information about a potential packet in the connection's buffer if the packet is complete, instanciates a new packet of the correct type and extracts the message from the connection all buffer manipulation is done in connection and IPacket classes

◆ GetInstance()

PacketFactory & PacketFactory::GetInstance ( )
static

Get a ref to the singleton instance of the PacketFactory.

◆ operator=() [1/2]

PacketFactory & PacketFactory::operator= ( const PacketFactory other)
delete

◆ operator=() [2/2]

PacketFactory & PacketFactory::operator= ( PacketFactory &&  other)
delete

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