wavelength 1.0.0
Loading...
Searching...
No Matches
inetdnslookupresultmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include "msg/message.h"
5#include "os/mem.h"
6
14public:
16 static constexpr int kResultFailed = -90;
17
26 InetDNSLookupResultMsg(int nResult, const char *pszAddress)
27 : mResult(nResult), mAddress(pszAddress) {
28 }
29
36 void *operator new(size_t nSize) {
37 return PoolMemAlloc(static_cast<int>(nSize), "InetDNSLookupResultMsg", 0);
38 }
39
45 void operator delete(void *pBlock) {
46 PoolMemFree(pBlock);
47 }
48
54 Message *Clone() override {
55 return new InetDNSLookupResultMsg(*this);
56 }
57
63 int Type() override {
65 }
66
72 const char *GetName() const override {
73 return "InetDNSLookupResultMsg";
74 }
75
83 void PrintExtra(PrnStream &stream) const override;
84
86 const char *GetAddress() const {
87 return mAddress;
88 }
89
91 int GetResult() const {
92 return mResult;
93 }
94
95private:
96 int mResult;
97 const char *mAddress;
98};
int GetResult() const
Definition inetdnslookupresultmsg.h:91
void PrintExtra(PrnStream &stream) const override
Write the result and the address.
InetDNSLookupResultMsg(int nResult, const char *pszAddress)
Construct a result.
Definition inetdnslookupresultmsg.h:26
int Type() override
Report this message's registered identity.
Definition inetdnslookupresultmsg.h:63
Message * Clone() override
Produce a heap copy of this message, which points at the same address text.
Definition inetdnslookupresultmsg.h:54
const char * GetAddress() const
Definition inetdnslookupresultmsg.h:86
const char * GetName() const override
Report this message's class name.
Definition inetdnslookupresultmsg.h:72
static constexpr int kResultFailed
The value of mResult after a failed lookup.
Definition inetdnslookupresultmsg.h:16
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
int g_nInetDNSLookupResultMsgType
Identity that InetDNSLookupResultMsg::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.