Symphony Of Empires
Eng3D::Networking::Packet Class Reference

#include <network.hpp>

Collaboration diagram for Eng3D::Networking::Packet:

Public Member Functions

 Packet ()=default
 
 Packet (int _fd)
 
 Packet (int _fd, const void *buf, size_t size)
 
 ~Packet ()=default
 
void * data ()
 
template<typename T >
void data (const T *buf=nullptr, size_t size=sizeof(T))
 
size_t size () const
 
bool is_ok () const
 
bool send ()
 
bool recv ()
 

Public Attributes

std::vector< uint8_t > buffer
 
SocketStream stream
 
std::function< bool()> pred
 

Detailed Description

Definition at line 99 of file network.hpp.

Constructor & Destructor Documentation

◆ Packet() [1/3]

Eng3D::Networking::Packet::Packet ( )
default

◆ Packet() [2/3]

Eng3D::Networking::Packet::Packet ( int  _fd)
inline

Definition at line 104 of file network.hpp.

◆ Packet() [3/3]

Eng3D::Networking::Packet::Packet ( int  _fd,
const void *  buf,
size_t  size 
)
inline

Definition at line 107 of file network.hpp.

Here is the call graph for this function:

◆ ~Packet()

Eng3D::Networking::Packet::~Packet ( )
default

Member Function Documentation

◆ data() [1/2]

void* Eng3D::Networking::Packet::data ( )
inline

Definition at line 113 of file network.hpp.

Here is the caller graph for this function:

◆ data() [2/2]

template<typename T >
void Eng3D::Networking::Packet::data ( const T *  buf = nullptr,
size_t  size = sizeof(T) 
)
inline

Definition at line 118 of file network.hpp.

Here is the call graph for this function:

◆ is_ok()

bool Eng3D::Networking::Packet::is_ok ( ) const
inline

Definition at line 129 of file network.hpp.

◆ recv()

bool Eng3D::Networking::Packet::recv ( )

Definition at line 181 of file network.cpp.

Here is the caller graph for this function:

◆ send()

bool Eng3D::Networking::Packet::send ( )

Definition at line 161 of file network.cpp.

Here is the caller graph for this function:

◆ size()

size_t Eng3D::Networking::Packet::size ( ) const
inline

Definition at line 125 of file network.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ buffer

std::vector<uint8_t> Eng3D::Networking::Packet::buffer

Definition at line 136 of file network.hpp.

◆ pred

std::function<bool()> Eng3D::Networking::Packet::pred

Definition at line 138 of file network.hpp.

◆ stream

SocketStream Eng3D::Networking::Packet::stream

Definition at line 137 of file network.hpp.


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