| |
| |
| #ifndef TIPC_MESSAGE_H |
| #define TIPC_MESSAGE_H |
| |
| |
| #include "tcommon.h" |
| |
| |
| #include <QDataStream> |
| #include <QLocalSocket> |
| |
| #include "tipc.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZCORE_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| namespace tipc |
| { |
| |
| |
| |
| |
| |
| class MessageParser |
| { |
| friend class Server; |
| |
| QLocalSocket *m_socket; |
| tipc::Stream *m_stream; |
| |
| public: |
| virtual QString header() const = 0; |
| virtual void operator()(Message &msg) = 0; |
| |
| QLocalSocket *socket() { return m_socket; } |
| tipc::Stream *stream() { return m_stream; } |
| }; |
| |
| |
| |
| |
| |
| enum DefMsgEnum { SHMEM_REQUEST, |
| SHMEM_RELEASE, |
| TMPFILE_REQUEST, |
| TMPFILE_RELEASE, |
| QUIT_ON_ERROR }; |
| |
| template <DefMsgEnum msgType> |
| class DVAPI DefaultMessageParser : public MessageParser |
| { |
| public: |
| QString header() const; |
| void operator()(Message &msg); |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| } |
| |
| #endif |
| |