|
@@ -10,9 +10,7 @@
|
|
|
|
|
|
|
|
#include "eventParameter.h"
|
|
#include "eventParameter.h"
|
|
|
|
|
|
|
|
-
|
|
|
|
|
#include <typedReferenceCount.h>
|
|
#include <typedReferenceCount.h>
|
|
|
-#include <namable.h>
|
|
|
|
|
|
|
|
|
|
class EventReceiver;
|
|
class EventReceiver;
|
|
|
|
|
|
|
@@ -22,14 +20,23 @@ class EventReceiver;
|
|
|
// any thread may throw an event at any time; there will
|
|
// any thread may throw an event at any time; there will
|
|
|
// be one process responsible for reading and dispacting
|
|
// be one process responsible for reading and dispacting
|
|
|
// on the events (but not necessarily immediately).
|
|
// on the events (but not necessarily immediately).
|
|
|
|
|
+//
|
|
|
|
|
+// This function use to inherit from Namable, but that
|
|
|
|
|
+// makes it too expensive to get its name the Python
|
|
|
|
|
+// code. Now it just copies the Namable interface in.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-class EXPCL_PANDAEXPRESS Event : public TypedReferenceCount, public Namable {
|
|
|
|
|
|
|
+class EXPCL_PANDAEXPRESS Event : public TypedReferenceCount {
|
|
|
PUBLISHED:
|
|
PUBLISHED:
|
|
|
Event(const string &event_name, EventReceiver *receiver = NULL);
|
|
Event(const string &event_name, EventReceiver *receiver = NULL);
|
|
|
Event(const Event ©);
|
|
Event(const Event ©);
|
|
|
void operator = (const Event ©);
|
|
void operator = (const Event ©);
|
|
|
~Event();
|
|
~Event();
|
|
|
|
|
|
|
|
|
|
+ INLINE void set_name(const string &name);
|
|
|
|
|
+ INLINE void clear_name();
|
|
|
|
|
+ INLINE bool has_name() const;
|
|
|
|
|
+ INLINE const string &get_name() const;
|
|
|
|
|
+
|
|
|
void add_parameter(const EventParameter &obj);
|
|
void add_parameter(const EventParameter &obj);
|
|
|
|
|
|
|
|
int get_num_parameters() const;
|
|
int get_num_parameters() const;
|
|
@@ -40,21 +47,24 @@ PUBLISHED:
|
|
|
void set_receiver(EventReceiver *receiver);
|
|
void set_receiver(EventReceiver *receiver);
|
|
|
void clear_receiver();
|
|
void clear_receiver();
|
|
|
|
|
|
|
|
|
|
+ void output(ostream &out) const;
|
|
|
|
|
+
|
|
|
protected:
|
|
protected:
|
|
|
typedef vector<EventParameter> ParameterList;
|
|
typedef vector<EventParameter> ParameterList;
|
|
|
ParameterList _parameters;
|
|
ParameterList _parameters;
|
|
|
EventReceiver *_receiver;
|
|
EventReceiver *_receiver;
|
|
|
|
|
|
|
|
|
|
+private:
|
|
|
|
|
+ string _name;
|
|
|
|
|
+
|
|
|
public:
|
|
public:
|
|
|
static TypeHandle get_class_type() {
|
|
static TypeHandle get_class_type() {
|
|
|
return _type_handle;
|
|
return _type_handle;
|
|
|
}
|
|
}
|
|
|
static void init_type() {
|
|
static void init_type() {
|
|
|
TypedReferenceCount::init_type();
|
|
TypedReferenceCount::init_type();
|
|
|
- Namable::init_type();
|
|
|
|
|
register_type(_type_handle, "Event",
|
|
register_type(_type_handle, "Event",
|
|
|
- TypedReferenceCount::get_class_type(),
|
|
|
|
|
- Namable::get_class_type());
|
|
|
|
|
|
|
+ TypedReferenceCount::get_class_type());
|
|
|
}
|
|
}
|
|
|
virtual TypeHandle get_type() const {
|
|
virtual TypeHandle get_type() const {
|
|
|
return get_class_type();
|
|
return get_class_type();
|
|
@@ -65,4 +75,8 @@ private:
|
|
|
static TypeHandle _type_handle;
|
|
static TypeHandle _type_handle;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+INLINE ostream &operator << (ostream &out, const Event &n);
|
|
|
|
|
+
|
|
|
|
|
+#include "event.I"
|
|
|
|
|
+
|
|
|
#endif
|
|
#endif
|