summaryrefslogtreecommitdiffstats
path: root/src/Common/Request
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Request')
-rw-r--r--src/Common/Request/DisconnectRequest.h8
-rw-r--r--src/Common/Request/IdentifyRequest.h8
-rw-r--r--src/Common/Request/Request.h23
3 files changed, 17 insertions, 22 deletions
diff --git a/src/Common/Request/DisconnectRequest.h b/src/Common/Request/DisconnectRequest.h
index 77509a0..48256a7 100644
--- a/src/Common/Request/DisconnectRequest.h
+++ b/src/Common/Request/DisconnectRequest.h
@@ -17,8 +17,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef DISCONNECTREQUEST_H_
-#define DISCONNECTREQUEST_H_
+#ifndef MAD_COMMON_REQUEST_DISCONNECTREQUEST_H_
+#define MAD_COMMON_REQUEST_DISCONNECTREQUEST_H_
#include "Request.h"
#include "../RequestManager.h"
@@ -35,7 +35,7 @@ class DisconnectRequest: public Request {
public:
static bool send(Net::Connection *connection, RequestManager &requestManager) {
- Request *request = new DisconnectRequest();
+ DisconnectRequest *request = new DisconnectRequest();
if(requestManager.sendRequest(connection, request))
return true;
@@ -73,4 +73,4 @@ class DisconnectRequest: public Request {
}
}
-#endif /* DISCONNECTREQUEST_H_ */
+#endif /* MAD_COMMON_REQUEST_DISCONNECTREQUEST_H_ */
diff --git a/src/Common/Request/IdentifyRequest.h b/src/Common/Request/IdentifyRequest.h
index 9df1548..bb98bad 100644
--- a/src/Common/Request/IdentifyRequest.h
+++ b/src/Common/Request/IdentifyRequest.h
@@ -17,8 +17,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef IDENTIFYREQUEST_H_
-#define IDENTIFYREQUEST_H_
+#ifndef MAD_COMMON_REQUEST_IDENTIFYREQUEST_H_
+#define MAD_COMMON_REQUEST_IDENTIFYREQUEST_H_
#include "Request.h"
#include "../RequestManager.h"
@@ -40,7 +40,7 @@ class IdentifyRequest: public Request {
public:
static bool send(Net::Connection *connection, RequestManager &requestManager, const std::string &hostname0) {
- Request *request = new IdentifyRequest(hostname0);
+ IdentifyRequest *request = new IdentifyRequest(hostname0);
if(requestManager.sendRequest(connection, request))
return true;
@@ -78,4 +78,4 @@ class IdentifyRequest: public Request {
}
}
-#endif /* IDENTIFYREQUEST_H_ */
+#endif /* MAD_COMMON_REQUEST_IDENTIFYREQUEST_H_ */
diff --git a/src/Common/Request/Request.h b/src/Common/Request/Request.h
index 211b2cd..e0fcf11 100644
--- a/src/Common/Request/Request.h
+++ b/src/Common/Request/Request.h
@@ -1,7 +1,7 @@
/*
* Request.h
*
- * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ * Copyright (C) 2008 Matthias Schiffer
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -20,38 +20,33 @@
#ifndef MAD_COMMON_REQUEST_REQUEST_H_
#define MAD_COMMON_REQUEST_REQUEST_H_
-namespace Mad {
+#include "../RequestHandler.h"
-namespace Net {
-class Connection;
-class Packet;
-}
+namespace Mad {
namespace Common {
+
namespace Request {
-class Request {
+class Request : public RequestHandler {
private:
- bool sent, finished;
+ bool sent;
protected:
- Request() : sent(false), finished(false) {}
+ Request() : sent(false) {}
void setSent() {sent = true;}
- void setFinished() {finished = true;}
public:
- virtual ~Request() {}
-
bool isSent() const {return sent;}
- bool isFinished() const {return finished;}
virtual bool sendRequest(Net::Connection *connection, unsigned short requestId) = 0;
- virtual bool handlePacket(Net::Connection *connection, const Net::Packet &packet) = 0;
};
}
+
}
+
}
#endif /* MAD_COMMON_REQUEST_REQUEST_H_ */