blob: 05a3798095924767840904f187799683b774df8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#ifndef COMETIOPROCESSOR_H_2CUY93KU
#define COMETIOPROCESSOR_H_2CUY93KU
#include "uscxml/concurrency/eventqueue/DelayedEventQueue.h"
#include "uscxml/server/HTTPServer.h"
#include "uscxml/Interpreter.h"
#include "uscxml/Factory.h"
#ifdef BUILD_AS_PLUGINS
#include "uscxml/plugins/Plugins.h"
#endif
namespace uscxml {
class CometIOProcessor : public IOProcessorImpl, public HTTPServlet {
public:
CometIOProcessor();
virtual ~CometIOProcessor();
virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
names.insert("comet");
names.insert("http://www.w3.org/TR/scxml/#CometEventProcessor");
return names;
}
/// This method can be overridden for specific replies
virtual void reply(const SendRequest& req, const HTTPServer::Request& longPoll);
virtual void send(const SendRequest& req);
Data getDataModelVariables();
virtual bool httpRecvRequest(const HTTPServer::Request& request);
virtual void setURL(const std::string& url) {
_url = url;
}
protected:
tthread::recursive_mutex _mutex;
std::string _url;
std::deque<SendRequest> _outQueue;
HTTPServer::Request _longPollingReq;
};
#ifdef BUILD_AS_PLUGINS
PLUMA_INHERIT_PROVIDER(CometIOProcessor, IOProcessorImpl);
#endif
}
#endif /* end of include guard: COMETIOPROCESSOR_H_2CUY93KU */
|