| 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 | |
|---|
| 15 | class Protocol; |
|---|
| 16 | class 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 | // -------------------------------------------------------------------------- |
|---|
| 26 | class Message |
|---|
| 27 | { |
|---|
| 28 | public: |
|---|
| 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 | /* |
|---|
| 47 | class Reply; |
|---|
| 48 | |
|---|
| 49 | class Request : public Message |
|---|
| 50 | { |
|---|
| 51 | public: |
|---|
| 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 | |
|---|
| 59 | class Reply : public Message |
|---|
| 60 | { |
|---|
| 61 | public: |
|---|
| 62 | Reply() { } |
|---|
| 63 | virtual ~Reply() { } |
|---|
| 64 | Reply(const Reply &rToCopy) { } |
|---|
| 65 | }; |
|---|
| 66 | */ |
|---|
| 67 | |
|---|
| 68 | #endif // PROTOCOLOBJECT__H |
|---|
| 69 | |
|---|