#define SRC_SERVICE_REQUEST_REQUEST_H_
#include <logic/Logic.h>
-#include "RequestContext.h"
namespace Cynara {
Request();
virtual ~Request();
- virtual void execute(Logic *logic, const RequestContext &context) = 0;
+ virtual void execute(Logic *logic, int sourceDesc) = 0;
};
} // namespace Cynara
* @brief This file implements request context class
*/
+#include <main/Cynara.h>
+#include <sockets/SocketManager.h>
+
#include "RequestContext.h"
namespace Cynara {
-RequestContext::RequestContext(int fd) : m_sourceFd(fd) {
+BinaryQueue &RequestContext::resultQueue(int fd) {
+ return Cynara::getSocketManager()->descriptor(fd).writeQueue();
+}
+
+Protocol *RequestContext::protocol(int fd) {
+ return Cynara::getSocketManager()->descriptor(fd).protocol();
}
} // namespace Cynara
#ifndef SRC_SERVICE_REQUEST_REQUESTCONTEXT_H_
#define SRC_SERVICE_REQUEST_REQUESTCONTEXT_H_
+#include <common.h>
+
+#include <protocol/Protocol.h>
+
namespace Cynara {
+class Protocol;
+
class RequestContext {
-public:
- RequestContext(int fd);
- int m_sourceFd;
+public:
+ static BinaryQueue &resultQueue(int fd);
+ static Protocol *protocol(int fd);
};
} // namespace Cynara
break;
LOGD("request extracted");
- req->execute(Cynara::getLogic(), {fd});
+ req->execute(Cynara::getLogic(), fd);
delete req;
if (desc.hasDataToWrite())