From 7e87778a02f3d37865c10051a3f14038bbbcbaef Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 13 Sep 2008 03:59:58 +0200 Subject: Benutze weniger Inline-Funktionen --- src/Client/Request/CoreStatusRequest.h | 51 ++++++++++------------------------ 1 file changed, 14 insertions(+), 37 deletions(-) (limited to 'src/Client/Request/CoreStatusRequest.h') diff --git a/src/Client/Request/CoreStatusRequest.h b/src/Client/Request/CoreStatusRequest.h index 328c4ff..1a6a01e 100644 --- a/src/Client/Request/CoreStatusRequest.h +++ b/src/Client/Request/CoreStatusRequest.h @@ -20,14 +20,22 @@ #ifndef MAD_CLIENT_REQUEST_CORESTATUSREQUEST_H_ #define MAD_CLIENT_REQUEST_CORESTATUSREQUEST_H_ -#include #include -#include -#include #include namespace Mad { + +namespace Common { +class RequestManager; +} + +namespace Net { +namespace Packets { +class HostStatusPacket; +} +} + namespace Client { namespace Request { @@ -38,41 +46,10 @@ class CoreStatusRequest: public Common::Request::Request { CoreStatusRequest() {} public: - static bool send(Net::Connection *connection, Common::RequestManager &requestManager, const sigc::slot &callback) { - CoreStatusRequest *request = new CoreStatusRequest(); - - request->finished.connect(callback); - - if(requestManager.sendRequest(connection, request)) - return true; - - delete request; - return false; - } - - virtual bool sendRequest(Net::Connection *connection, uint16_t requestId) { - if(isSent()) - return false; - - if(!connection->send(Net::Packet(Net::Packet::CORE_STATUS, requestId))) - return false; - - setSent(); - return true; - } - - virtual bool handlePacket(Net::Connection*, const Net::Packet &packet) { - if(isFinished()) - return false; - - if(packet.getType() != Net::Packet::OK) - return false; // TODO Logging - - finished(Net::Packets::HostStatusPacket(packet)); + static bool send(Net::Connection *connection, Common::RequestManager &requestManager, const sigc::slot &callback); - setFinished(); - return true; - } + virtual bool sendRequest(Net::Connection *connection, uint16_t requestId); + virtual bool handlePacket(Net::Connection*, const Net::Packet &packet); }; } -- cgit v1.2.3