Don't dispatch virtual methods for builtin classes (reduces overhead).
Annotate for file src/libsmoke/smokebinding.h
2010-01-10 tobias 1 #ifndef SMOKEBINDING_H
08:49:36 ' 2 #define SMOKEBINDING_H
2009-04-05 tobias 3
15:36:29 ' 4 #include <smoke.h>
' 5
' 6 namespace cl_smoke
' 7 {
' 8
2010-02-18 tobias 9 class NoDispatchBinding : public SmokeBinding
2009-04-05 tobias 10 {
15:36:29 ' 11 public:
2009-06-22 tobias 12 typedef void (*destructed)(void* object);
2009-04-05 tobias 13
2010-02-18 tobias 14 NoDispatchBinding(Smoke *smoke, destructed destruct);
2009-04-05 tobias 15
15:36:29 ' 16 virtual void
2009-06-22 tobias 17 deleted(Smoke::Index classId, void *object);
2009-04-05 tobias 18
15:36:29 ' 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
2010-02-19 tobias 26 Smoke*
2010-02-18 tobias 27 get_smoke() const
19:57:00 ' 28 { return smoke; }
2010-02-19 tobias 29
2009-04-05 tobias 30 private:
15:36:29 ' 31 const destructed destruct;
2010-02-18 tobias 32 };
19:57:00 ' 33
' 34 class Binding : public NoDispatchBinding
' 35 {
' 36 public:
' 37 typedef int (*dispatch_method)(Binding* binding, Smoke::Index method,
' 38 void* object, Smoke::Stack args, int abstract);
' 39
' 40 Binding(Smoke *smoke, destructed destruct, dispatch_method dispatch);
' 41
' 42
' 43 virtual bool
' 44 callMethod(Smoke::Index method, void* object,
' 45 Smoke::Stack stack, bool abstract);
' 46
' 47
' 48 private:
2009-04-05 tobias 49 const dispatch_method dispatch;
15:36:29 ' 50 };
' 51
' 52 } // namespace cl_smoke
' 53
2010-01-10 tobias 54 #endif // SMOKEBINDING_H