00001 /* Copyright (C) GridGain Systems. All Rights Reserved. */ 00002 00003 /* _________ _____ __________________ _____ 00004 * __ ____/___________(_)______ /__ ____/______ ____(_)_______ 00005 * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ 00006 * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / 00007 * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ 00008 */ 00009 00010 #ifndef GRID_CLIENT_MESSAGE_HPP_INCLUDED 00011 #define GRID_CLIENT_MESSAGE_HPP_INCLUDED 00012 00013 #include <cstdlib> 00014 #include <cstdint> 00015 00016 #include <string> 00017 #include <iostream> 00018 00019 #include "gridgain/gridclientuuid.hpp" 00020 00024 class GridClientMessage { 00025 public: 00026 GridClientMessage(): reqId(1) { 00027 } 00028 00030 virtual ~GridClientMessage() {}; 00031 00037 int64_t getRequestId() const { return reqId; } 00038 00044 void setRequestId(int64_t pReqId) { reqId = pReqId; } 00045 00051 GridClientUuid getClientId() const { return clientId; } 00052 00058 void setClientId(const GridClientUuid& id) { 00059 clientId = id; 00060 } 00061 00067 std::string sessionToken() const { 00068 return sessTok; 00069 } 00070 00076 void sessionToken(const std::string& pSessTok) { 00077 sessTok = pSessTok; 00078 } 00079 00085 GridClientUuid getDestinationId() const { 00086 return destinationId; 00087 } 00088 00094 void setDestinationId(const GridClientUuid& destinationId) { 00095 this->destinationId = destinationId; 00096 } 00097 00103 static int generateNewId() { 00104 return rand(); 00105 } 00106 private: 00108 GridClientUuid clientId; 00109 00111 std::string sessTok; 00112 00114 int64_t reqId; 00115 00117 GridClientUuid destinationId; 00118 }; 00119 00120 #endif
1.7.1