1 #ifndef _ots_WorkLoopManager_h
2 #define _ots_WorkLoopManager_h
4 #include <toolbox/task/WorkLoop.h>
5 #pragma GCC diagnostic push
6 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
7 #include <xgi/Method.h>
8 #pragma GCC diagnostic pop
9 #include <xoap/MessageReference.h>
17 class HttpXmlDocument;
23 typedef unsigned long long RequestNumber;
37 bool report(toolbox::task::WorkLoop* workLoop, std::string result,
float progress,
bool status);
38 bool removeProcessedRequests(
void);
39 std::string getWorkLoopRequest(toolbox::task::WorkLoop* workLoop);
40 void translateWorkLoopName(toolbox::task::WorkLoop* workLoop,
SOAPCommand& soapCommand);
44 xoap::MessageReference getMessage(toolbox::task::WorkLoop* workLoop);
47 const std::string cWorkLoopType_;
58 toolbox::task::WorkLoop* workLoop;
59 std::string workLoopName;
64 time_t requestStartTime;
65 time_t requestLastTimeChecked;
66 xoap::MessageReference message;
68 HttpXmlDocument processRequest(std::string workLoopName,
const xoap::MessageReference* message = 0);
69 bool removeWorkLoop(toolbox::task::WorkLoop* workLoop);
70 bool removeWorkLoop(RequestNumber requestNumber);
71 bool removeTimedOutRequests(
void);
72 std::string composeWorkLoopName(RequestNumber requestNumber, cgicc::Cgicc& cgi);
73 std::string composeWorkLoopName(RequestNumber requestNumber,
const xoap::MessageReference& message);
74 RequestNumber getWorkLoopRequestNumber(toolbox::task::WorkLoop* workLoop);
75 RequestNumber getWorkLoopRequestNumber(std::string workLoopName);
80 std::string getWorkLoopRequest(std::string workLoopName);
85 std::map<RequestNumber, WorkLoopStruct> workLoops_;
86 toolbox::task::ActionSignature* job_;
87 unsigned long long requestNumber_;
88 std::string requestName_;