/ src / libsmoke /
src/libsmoke/smokebinding.h
1 #ifndef SMOKEBINDING_H
2 #define SMOKEBINDING_H
3
4 #include <smoke.h>
5
6 namespace cl_smoke
7 {
8
9 class NoDispatchBinding : public SmokeBinding
10 {
11 public:
12 typedef void (*destructed)(void* object);
13
14 NoDispatchBinding(destructed destruct);
15
16 virtual void
17 deleted(Smoke::Index classId, void *object);
18
19 virtual bool
20 callMethod(Smoke::Index method, void* object,
21 Smoke::Stack stack, bool abstract);
22
23 virtual char*
24 className(Smoke::Index classId);
25
26 private:
27 const destructed destruct;
28 };
29
30 class Binding : public NoDispatchBinding
31 {
32 public:
33 typedef int (*dispatch_method)(Smoke::Index method,
34 void* object, Smoke::Stack args, int abstract);
35
36 Binding(destructed destruct, dispatch_method dispatch);
37
38
39 virtual bool
40 callMethod(Smoke::Index method, void* object,
41 Smoke::Stack stack, bool abstract);
42
43
44 private:
45 const dispatch_method dispatch;
46 };
47
48 } // namespace cl_smoke
49
50 #endif // SMOKEBINDING_H