wavelength 1.0.0
Loading...
Searching...
No Matches
messagefactory.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "msg/message.h"
6
8typedef Message *(*MessageFactoryProc)();
9
18public:
20 struct Entry {
21 int mType;
23
30 bool operator<(const Entry &other) const {
31 return mType < other.mType;
32 }
33 };
34
43 MessageFactory(int nType, MessageFactoryProc pfnCreate);
44
52 static std::vector<Entry> *List();
53};
MessageFactory(int nType, MessageFactoryProc pfnCreate)
Insert a factory into the list, ordered by identity.
static std::vector< Entry > * List()
Report the factory list, which is constructed on first use and destroyed at exit.
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Message *(* MessageFactoryProc)()
Produces one default-constructed message of a registered class.
Definition messagefactory.h:8
One entry of the factory list.
Definition messagefactory.h:20
int mType
Definition messagefactory.h:21
MessageFactoryProc mCreate
Definition messagefactory.h:22
bool operator<(const Entry &other) const
Order entries by identity.
Definition messagefactory.h:30