// don't use virtual functions here; we don't want the
// compiler to create tons of per-polymorphic-class stuff that
// we'll never need. We just use one function pointer.
+ typedef void (*ImplFn)(int which, QSlotObjectBase* this_, QObject *receiver, void **args, bool *ret);
+ const ImplFn impl;
+ protected:
enum Operation {
Destroy,
Call,
NumOperations
};
- typedef void (*ImplFn)(int which, QSlotObjectBase* this_, QObject *receiver, void **args, bool *ret);
- const ImplFn impl;
-
+ public:
explicit QSlotObjectBase(ImplFn fn) : ref(1), impl(fn) {}
+
inline void destroy() { impl(Destroy, this, 0, 0, 0); }
inline bool compare(void **a) { bool ret; impl(Compare, this, 0, a, &ret); return ret; }
inline void call(QObject *r, void **a) { impl(Call, this, r, a, 0); }