wavelength 1.0.0
Loading...
Searching...
No Matches
filelistmsg.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#include "os/string.h"
9
16class FileListMsg : public Message {
17public:
24 ~FileListMsg() override = default;
25
33 explicit FileListMsg(std::list<String> *pFiles) : mFiles(pFiles) {
34 }
35
42 void *operator new(size_t nSize) {
43 return PoolMemAlloc(static_cast<int>(nSize), "FileListMsg", 0);
44 }
45
51 void operator delete(void *pBlock) {
52 PoolMemFree(pBlock);
53 }
54
62 Message *Clone() override {
63 return new FileListMsg(*this);
64 }
65
73 int Type() override {
74 return g_nFileListMsgType;
75 }
76
84 const char *GetName() const override {
85 return "FileListMsg";
86 }
87
89 std::list<String> *GetFiles() const {
90 return mFiles;
91 }
92
93private:
94 std::list<String> *mFiles;
95};
Message * Clone() override
Produce a heap copy of this message, which points at the same names.
Definition filelistmsg.h:62
int Type() override
Report this message's registered identity.
Definition filelistmsg.h:73
FileListMsg(std::list< String > *pFiles)
Construct a message that points at the names.
Definition filelistmsg.h:33
~FileListMsg() override=default
Destroy the object.
const char * GetName() const override
Report this message's class name.
Definition filelistmsg.h:84
std::list< String > * GetFiles() const
Definition filelistmsg.h:89
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
int g_nFileListMsgType
Identity that FileListMsg::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.