wavelength 1.0.0
Loading...
Searching...
No Matches
dataackpkt.h
Go to the documentation of this file.
1#pragma once
2
4#include "os/mem.h"
5
12extern int g_nDataAckPktType;
13
21class DataAckPkt : public InternalPacket {
22public:
29 ~DataAckPkt() override = default;
30
32 static constexpr int kHost = 0;
33
41
49 static Message *New();
50
57 void *operator new(size_t nSize) {
58 return PoolMemAlloc(static_cast<int>(nSize), "DataAckPkt", 0);
59 }
60
66 void operator delete(void *pBlock) {
67 PoolMemFree(pBlock);
68 }
69
77 Message *Clone() override {
78 return new DataAckPkt(*this);
79 }
80
88 int Type() override {
89 return g_nDataAckPktType;
90 }
91
99 const char *GetName() const override {
100 return "DataAckPkt";
101 }
102};
static constexpr int kHost
The identifier in the session of the host, the receiver of every packet of the class.
Definition dataackpkt.h:32
static Message * New()
Produce a default-constructed packet on the heap.
~DataAckPkt() override=default
Destroy the object.
DataAckPkt()
Construct a packet for the host.
Definition dataackpkt.h:39
Message * Clone() override
Produce a heap copy of this packet.
Definition dataackpkt.h:77
int Type() override
Report this packet's registered identity.
Definition dataackpkt.h:88
const char * GetName() const override
Report this packet's class name.
Definition dataackpkt.h:99
InternalPacket(unsigned char nFlags=0, int nReceiver=kUnset)
Construct a packet from an unset sender.
Definition internalpacket.h:33
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
static constexpr unsigned char kFlagGuaranteed
Bit of mFlags that NetTransport::Send() turns into its guaranteed delivery bit.
Definition packet.h:28
int g_nDataAckPktType
Identity that DataAckPkt::Type() reports.
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.