bool (*equal_callback) (void *, void *);
} Listener_function_table;
-class Listener
+class Listener : public Simple_smob<Listener>
{
+public:
+ static SCM equal_p (SCM, SCM);
+ SCM mark_smob ();
+ static const char type_p_name_[];
+private:
void *target_;
Listener_function_table *type_;
public:
void listen (SCM ev) const;
bool operator == (Listener const &other) const
- { return type_ == other.type_
- && (*type_->equal_callback)((void *) target_, (void *) other.target_ );
+ {
+ return type_ == other.type_
+ && (*type_->equal_callback) ((void *) target_, (void *) other.target_);
}
- DECLARE_SIMPLE_SMOBS (Listener);
};
-DECLARE_UNSMOB (Listener, listener);
#define IMPLEMENT_LISTENER(cl, method) \
void \
inline void name (SCM); \
static void name ## _callback (void *self, SCM ev); \
static void name ## _mark (void *self); \
- static bool name ## _is_equal (void *a, void *b); \
+ static bool name ## _is_equal (void *a, void *b); \
Listener name ## _listener () const
#endif /* LISTENER_HH */