wavelength 1.0.0
Loading...
Searching...
No Matches
lobbychatroomsmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "msg/message.h"
8#include "os/mem.h"
9
16class LobbyChatroomsMsg : public Message {
17public:
25 explicit LobbyChatroomsMsg(std::list<NetChatroomInfo> *pChatrooms) : mChatrooms(pChatrooms) {
26 }
27
34 void *operator new(size_t nSize) {
35 return PoolMemAlloc(static_cast<int>(nSize), "LobbyChatroomsMsg", 0);
36 }
37
43 void operator delete(void *pBlock) {
44 PoolMemFree(pBlock);
45 }
46
52 Message *Clone() override {
53 return new LobbyChatroomsMsg(*this);
54 }
55
61 int Type() override {
63 }
64
70 const char *GetName() const override {
71 return "LobbyChatroomsMsg";
72 }
73
81 void PrintExtra(PrnStream &stream) const override;
82
84 std::list<NetChatroomInfo> *GetChatrooms() const {
85 return mChatrooms;
86 }
87
88private:
89 std::list<NetChatroomInfo> *mChatrooms;
90};
int Type() override
Report this message's registered identity.
Definition lobbychatroomsmsg.h:61
LobbyChatroomsMsg(std::list< NetChatroomInfo > *pChatrooms)
Construct a message that points at the rooms.
Definition lobbychatroomsmsg.h:25
std::list< NetChatroomInfo > * GetChatrooms() const
Definition lobbychatroomsmsg.h:84
Message * Clone() override
Produce a heap copy of this message, which points at the same rooms.
Definition lobbychatroomsmsg.h:52
const char * GetName() const override
Report this message's class name.
Definition lobbychatroomsmsg.h:70
void PrintExtra(PrnStream &stream) const override
Write the rooms.
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_nLobbyChatroomsMsgType
Identity that LobbyChatroomsMsg::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.