wavelength 1.0.0
Loading...
Searching...
No Matches
inetconfigsresultmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "msg/message.h"
7#include "os/mem.h"
8
16
24public:
32 explicit InetConfigsResultMsg(int nResult) : mResult(nResult) {
33 }
34
41 void *operator new(size_t nSize) {
42 return PoolMemAlloc(static_cast<int>(nSize), "InetConfigsResultMsg", 0);
43 }
44
50 void operator delete(void *pBlock) {
51 PoolMemFree(pBlock);
52 }
53
60 ~InetConfigsResultMsg() override = default;
61
69 Message *Clone() override {
70 return new InetConfigsResultMsg(*this);
71 }
72
80 int Type() override {
82 }
83
91 const char *GetName() const override {
92 return "InetConfigsResultMsg";
93 }
94
102 void PrintExtra(PrnStream &stream) const override;
103
105 const std::list<InetConfig> &GetConfigs() const {
106 return mConfigs;
107 }
108
110 std::list<InetConfig> &GetConfigs() {
111 return mConfigs;
112 }
113
115 int GetResult() const {
116 return mResult;
117 }
118
119private:
120 int mResult;
121 std::list<InetConfig> mConfigs;
122};
const char * GetName() const override
Report this message's class name.
Definition inetconfigsresultmsg.h:91
const std::list< InetConfig > & GetConfigs() const
Definition inetconfigsresultmsg.h:105
int GetResult() const
Definition inetconfigsresultmsg.h:115
InetConfigsResultMsg(int nResult)
Construct a result with no configurations.
Definition inetconfigsresultmsg.h:32
Message * Clone() override
Produce a heap copy of this message.
Definition inetconfigsresultmsg.h:69
~InetConfigsResultMsg() override=default
Release the message and its configurations.
void PrintExtra(PrnStream &stream) const override
Write the result, and the configurations after a success.
int Type() override
Report this message's registered identity.
Definition inetconfigsresultmsg.h:80
std::list< InetConfig > & GetConfigs()
Definition inetconfigsresultmsg.h:110
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_nInetConfigsResultMsgType
Identity that InetConfigsResultMsg::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.