2005-06-28 01:04:34 +02:00
|
|
|
#ifndef MESSAGEPASSER_H__
|
|
|
|
#define MESSAGEPASSER_H__
|
|
|
|
|
2005-06-25 04:21:26 +02:00
|
|
|
namespace AtlasMessage
|
|
|
|
{
|
|
|
|
|
2005-07-03 18:25:48 +02:00
|
|
|
template <typename T> class MessagePasser
|
2005-06-25 04:21:26 +02:00
|
|
|
{
|
|
|
|
public:
|
2005-07-03 18:25:48 +02:00
|
|
|
virtual void Add(T*)=0;
|
|
|
|
virtual T* Retrieve()=0;
|
2005-06-25 04:21:26 +02:00
|
|
|
};
|
|
|
|
|
2005-07-03 18:25:48 +02:00
|
|
|
struct mCommand;
|
|
|
|
struct mInput;
|
|
|
|
extern MessagePasser<mCommand>* g_MessagePasser_Command;
|
|
|
|
extern MessagePasser<mInput>* g_MessagePasser_Input;
|
2005-06-28 01:04:34 +02:00
|
|
|
|
2005-09-15 07:31:49 +02:00
|
|
|
#define POST_COMMAND(type) AtlasMessage::g_MessagePasser_Command->Add(new AtlasMessage::m##type)
|
|
|
|
#define POST_INPUT(type) AtlasMessage::g_MessagePasser_Input -> Add(new AtlasMessage::m##type)
|
2005-06-25 04:21:26 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-06-28 01:04:34 +02:00
|
|
|
#endif // MESSAGEPASSER_H__
|