source: box/trunk/lib/server/Message.h @ 2983

Revision 2983, 1.6 KB checked in by chris, 9 months ago (diff)

Combine client and server protocols to make way for an offline/local protocol.

Rename ProtocolObject? to Message.

  • Property svn:eol-style set to native
Line 
1// --------------------------------------------------------------------------
2//
3// File
4//              Name:    Message.h
5//              Purpose: Protocol object base class
6//              Created: 2003/08/19
7//
8// --------------------------------------------------------------------------
9
10#ifndef PROTOCOLOBJECT__H
11#define PROTOCOLOBJECT__H
12
13#include <memory>
14
15class Protocol;
16class ProtocolContext;
17
18// --------------------------------------------------------------------------
19//
20// Class
21//              Name:    Message
22//              Purpose: Basic object representation of objects to pass through a Protocol session
23//              Created: 2003/08/19
24//
25// --------------------------------------------------------------------------
26class Message
27{
28public:
29        Message();
30        virtual ~Message();
31        Message(const Message &rToCopy);
32
33        // Info about this object
34        virtual int GetType() const;
35        virtual bool IsError(int &rTypeOut, int &rSubTypeOut) const;
36        virtual bool IsConversationEnd() const;
37
38        // reading and writing with Protocol objects
39        virtual void SetPropertiesFromStreamData(Protocol &rProtocol);
40        virtual void WritePropertiesToStreamData(Protocol &rProtocol) const;   
41
42        virtual void LogSysLog(const char *Action) const { }
43        virtual void LogFile(const char *Action, FILE *file) const { }
44};
45
46/*
47class Reply;
48
49class Request : public Message
50{
51public:
52        Request() { }
53        virtual ~Request() { }
54        Request(const Request &rToCopy) { }
55        virtual std::auto_ptr<Reply> DoCommand(Protocol &rProtocol,
56                ProtocolContext &rContext) = 0;
57};
58
59class Reply : public Message
60{
61public:
62        Reply() { }
63        virtual ~Reply() { }
64        Reply(const Reply &rToCopy) { }
65};
66*/
67
68#endif // PROTOCOLOBJECT__H
69
Note: See TracBrowser for help on using the repository browser.