Leviathan  0.8.0.0
Leviathan game engine
Leviathan::SentResponse Class Reference

Stores Responses that want confirmation that they have arrived. More...

#include <SentNetworkThing.h>

+ Inheritance diagram for Leviathan::SentResponse:

Public Member Functions

DLLEXPORT SentResponse (uint32_t sentinpacket, uint32_t messagenumber, RECEIVE_GUARANTEE guarantee, const std::shared_ptr< NetworkResponse > response)
 
- Public Member Functions inherited from Leviathan::SentNetworkThing
DLLEXPORT SentNetworkThing (uint32_t packetid, uint32_t messagenumber, RECEIVE_GUARANTEE guarantee)
 
DLLEXPORT ~SentNetworkThing ()
 
bool IsFinalized ()
 Returns true once the packet has been received by the target or lost too many times. More...
 
DLLEXPORT void OnFinalized (bool succeeded)
 Called by Connection once this is done. More...
 
DLLEXPORT bool GetStatus ()
 Gets the status once IsFinalized returns true blocks otherwise. More...
 
DLLEXPORT void SetWaitStatus (bool status)
 Sets the status of the wait object notifying all waiters that this has succeeded or failed. More...
 
DLLEXPORT void SetAsTimed ()
 Sets this packet as a timed packet. More...
 
DLLEXPORT void ResetStartTime ()
 Resets the start time. More...
 
DLLEXPORT void SetCallback (std::shared_ptr< CallbackType > func=nullptr)
 Binds a callback function that is called either when the packet is successfully sent or it times out. More...
 
DLLEXPORT void SetCallbackFunc (CallbackType func)
 

Public Attributes

std::shared_ptr< NetworkResponseSentResponseData
 
- Public Attributes inherited from Leviathan::SentNetworkThing
uint32_t PacketNumber
 Contained in Local packet id. More...
 
const uint32_t MessageNumber
 
RECEIVE_GUARANTEE Resend = RECEIVE_GUARANTEE::None
 If not RECEIVE_GUARANTEE::None this packet will be resent if considered lost. More...
 
uint8_t AttemptNumber = 1
 
std::shared_ptr< std::function< void(bool, SentNetworkThing &)> > Callback
 
std::atomic< int64_t > ConfirmReceiveTime { 0 }
 The time when this packed got marked as received. More...
 
int64_t RequestStartTime { 0 }
 Time this was started. Used to time out this packet and calculate round trip time. More...
 
std::atomic< DONE_STATUSIsDone { DONE_STATUS::WAITING }
 Set to true once this object is no longer used. More...
 

Additional Inherited Members

- Public Types inherited from Leviathan::SentNetworkThing
enum  DONE_STATUS { DONE_STATUS::WAITING, DONE_STATUS::DONE, DONE_STATUS::FAILED }
 
using CallbackType = std::function< void(bool, SentNetworkThing &)>
 

Detailed Description

Stores Responses that want confirmation that they have arrived.

Definition at line 122 of file SentNetworkThing.h.

Constructor & Destructor Documentation

◆ SentResponse()

DLLEXPORT SentResponse::SentResponse ( uint32_t  sentinpacket,
uint32_t  messagenumber,
RECEIVE_GUARANTEE  guarantee,
const std::shared_ptr< NetworkResponse response 
)

Definition at line 84 of file SentNetworkThing.cpp.

85  :
86  SentNetworkThing(sentinpacket, messagenumber, guarantee), SentResponseData(response)
87 {
88 
89 }
std::shared_ptr< NetworkResponse > SentResponseData
DLLEXPORT SentNetworkThing(uint32_t packetid, uint32_t messagenumber, RECEIVE_GUARANTEE guarantee)

Member Data Documentation

◆ SentResponseData

std::shared_ptr<NetworkResponse> Leviathan::SentResponse::SentResponseData

Definition at line 128 of file SentNetworkThing.h.


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