SmartOS/Message/MessageBase.h

28 lines
595 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __MessageBase_H__
#define __MessageBase_H__
#include "Kernel\Sys.h"
#include "Message.h"
// 应用消息基类
class MessageBase : public Object
{
public:
bool Reply; // 是否响应
bool Error; // 是否错误
// 初始化消息各字段为0
MessageBase();
MessageBase(const MessageBase& msg);
// 从数据流中读取消息
virtual bool Read(Stream& ms) = 0;
// 把消息写入数据流中
virtual void Write(Stream& ms) const = 0;
virtual bool ReadMessage(const Message& msg);
virtual void WriteMessage(Message& msg) const;
};
#endif