Stormancer::Packet< T > Class Template Reference

Expose a stream for reading data received from the network. More...

#include <Packet.h>

Public Member Functions

 Packet (std::shared_ptr< T > source, const std::unordered_map< std::string, std::string > &metadata=std::unordered_map< std::string, std::string >())
 
 Packet (std::shared_ptr< T > source, byte *data, std::streamsize dataSize, const std::unordered_map< std::string, std::string > &metadata=std::unordered_map< std::string, std::string >())
 
virtual ~Packet ()
 Destructor.
 
template<typename TOut >
TOut readObject ()
 Read a serialized object.
 
template<typename... Args>
void readObjects (Args &... args)
 Read many serialized objects.
 

Public Attributes

std::shared_ptr< T > connection
 Source.
 
ibytestream stream
 Data stream.
 
std::unordered_map< std::string, std::string > metadata
 Metadata.
 
std::shared_ptr< Packet< IConnection > > originalPacket
 

Detailed Description

template<typename T = IConnection>
class Stormancer::Packet< T >

Expose a stream for reading data received from the network.

Constructor & Destructor Documentation

◆ Packet() [1/2]

template<typename T = IConnection>
Stormancer::Packet< T >::Packet ( std::shared_ptr< T >  source,
const std::unordered_map< std::string, std::string > &  metadata = std::unordered_map<std::string, std::string>() 
)
inline

Constructor

Parameters
sourceGeneric source of the packets.

◆ Packet() [2/2]

template<typename T = IConnection>
Stormancer::Packet< T >::Packet ( std::shared_ptr< T >  source,
byte *  data,
std::streamsize  dataSize,
const std::unordered_map< std::string, std::string > &  metadata = std::unordered_map<std::string, std::string>() 
)
inline

Constructor

Parameters
sourceGeneric source of the packets.
streamData stream attached to the packet.
metadataMetadata attached to this packet.

Member Data Documentation

◆ originalPacket

template<typename T = IConnection>
std::shared_ptr<Packet<IConnection> > Stormancer::Packet< T >::originalPacket

Original packet Used to keep the original packet alive (in case of async process)


The documentation for this class was generated from the following files:
  • stormancer/stormancer-sources/include/public/stormancer/IPlugin.h
  • stormancer/stormancer-sources/include/public/stormancer/Packet.h