summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h
blob: 9a6cb479988c03b5db6c2710efb85cf17679d9c7 (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
54
#ifndef HEARTBEATINVOKER_H_W09J90F0
#define HEARTBEATINVOKER_H_W09J90F0

#include <uscxml/Interpreter.h>

#ifdef BUILD_AS_PLUGINS
#include "uscxml/plugins/Plugins.h"
#endif

namespace uscxml {

class HeartbeatInvoker : public Invoker {
public:
	HeartbeatInvoker();
	virtual ~HeartbeatInvoker();
	virtual Invoker* create(Interpreter* interpreter);

	virtual std::set<std::string> getNames() {
		std::set<std::string> names;
		names.insert("heartbeat");
		names.insert("http://uscxml.tk.informatik.tu-darmstadt.de/#heartbaet");
		return names;
	}

	virtual Data getDataModelVariables();
	virtual void send(SendRequest& req);
	virtual void cancel(const std::string sendId);
	virtual void invoke(InvokeRequest& req);
	virtual void sendToParent(SendRequest& req);

  static void dispatch(void* instance, std::string name);
  
protected:
	std::string _invokeId;
  Event _event;
  
};

class HeartbeatDispatcher : public DelayedEventQueue {
public:
  static HeartbeatDispatcher* getInstance();
protected:
  static HeartbeatDispatcher* _instance;
  HeartbeatDispatcher();
};
  
#ifdef BUILD_AS_PLUGINS
PLUMA_INHERIT_PROVIDER(HeartbeatInvoker, Invoker);
#endif

}


#endif /* end of include guard: HEARTBEATINVOKER_H_W09J90F0 */