SmartOS/Message/MessageBase.h

27 lines
523 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 "Sys.h"
#include "Stream.h"
#include "Message.h"
// 应用消息基类
class MessageBase : public Object
{
public:
bool Reply; // 是否响应
// 初始化消息各字段为0
MessageBase();
// 从数据流中读取消息
virtual bool Read(Stream& ms) = 0;
// 把消息写入数据流中
virtual void Write(Stream& ms) = 0;
virtual bool ReadMessage(Message& msg);
virtual void WriteMessage(Message& msg);
};
#endif