Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
EventObject Class Reference

Base class for all objects wanting to send or receive events. More...

Inheritance diagram for EventObject:
CoreCustomData CoreBaseObject CoreBaseType AppBase AppMainMenu AppPreferences AppSelection AppUnits CacheRules ColorIO FCurve GroupManager GuiAction GuiAppMainMenu GuiGraphItem GuiIcon GuiImage GuiImageHistory GuiNodalItem GuiToolHandler GuiWidget OfChannelManager OfClassFactory OfCommandManager OfItem OfNodalPositionManager OfObjectFactory OfOverrides OfTime OfVars ResourceData ResourceUser

Classes

class  EventInfo
 Class used to give custom data through events calls. The receiver must have knowledge how to interpret the data, depending on what it registered on. More...
 
struct  EventReceiverInfo
 
union  EventReceiverInfo.__unnamed__
 

Public Types

typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 

Public Member Functions

 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject ()
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
virtual size_t get_memory_size () const
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Static Public Member Functions

static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
- Static Public Member Functions inherited from CoreCustomData
static void * get_custom_data_key (const CoreString &key)
 
- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 
- Static Public Member Functions inherited from CoreBaseType
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
static const CoreClassInfoclass_info ()
 

Detailed Description

Base class for all objects wanting to send or receive events.


Class Documentation

struct EventObject::EventReceiverInfo
Class Members
union EventReceiverInfo __unnamed__
void * data
bool dead_connection
bool info_usage
EventObject * receiver
union EventObject::EventReceiverInfo.__unnamed__
Class Members
EventFunction function
EventInfoFunction info_function
EventInfoMethod info_method
EventMethod method

Member Function Documentation

void EventObject::connect ( EventObject sender,
const CoreString event_id,
EventMethod  event_cb,
void *  data = 0 
)

Connects this to an object to listen to a specific event.

Parameters
[in]senderobject to connect on to listen to event
[in]event_idevent to listen to
[in]event_cbcallback to call when object send the event (receiver object method)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
EventMethod  event_cb,
void *  data = 0 
)

Connects this to an object to listen any of its events.

Parameters
[in]senderobject to connect on to listen to event
[in]event_cbcallback to call when object send any event (receiver object method)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
const CoreString event_id,
EventInfoMethod  event_cb,
void *  data = 0 
)

Connects this to an object to listen to a specific event.

Parameters
[in]senderobject to connect on to listen to event
[in]event_infoevent info (contains event id and custom data)
[in]event_cbcallback to call when object send the event (receiver object method)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
EventInfoMethod  event_cb,
void *  data = 0 
)

Connects this to an object to listen any of its events.

Parameters
[in]senderobject to connect on to listen to event
[in]event_cbcallback to call when object send any event (receiver object method)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
const CoreString event_id,
EventFunction  event_cb,
void *  data = 0 
)
static

Connects to an object to listen to a specific event.

Parameters
[in]senderobject to connect on to listen to event
[in]event_idevent to listen to
[in]event_cbcallback to call when object send the event (static or c function)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
EventFunction  event_cb,
void *  data = 0 
)
static

Connects to an object to listen any of its events.

Parameters
[in]senderobject to connect on to listen to event
[in]event_cbcallback to call when object send any event (receiver object method)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
const CoreString event_id,
EventInfoFunction  event_cb,
void *  data = 0 
)
static

Connects to an object to listen to a specific event.

Parameters
[in]senderobject to connect on to listen to event
[in]event_idevent to listen to
[in]event_cbcallback to call when object send the event (static or c function)
[in]datauser data given to callback when its called
void EventObject::connect ( EventObject sender,
EventInfoFunction  event_cb,
void *  data = 0 
)
static

Connects to an object to listen any of its events.

Parameters
[in]senderobject to connect on to listen to event
[in]event_cbcallback to call when object send any event (receiver object method)
[in]datauser data given to callback when its called
bool EventObject::disconnect ( EventObject sender,
const CoreString event_id,
EventFunction  event_cb,
void *  data = 0 
)
static

Disconnects this from an object for a specific event.

Parameters
[in]senderobject to connect on to listen to event
[in]event_idevent to listen to
[in]event_cbcallback to call when object send the event (static or c function)
[in]datauser data given to callback when its called
Returns
true if connection was successful, false otherwise
bool EventObject::disconnect ( EventObject sender,
const CoreString event_id,
EventMethod  event_cb,
void *  data = 0 
)

Disconnects this from an object for a specific event.

Parameters
[in]senderobject to connect on to listen to event
[in]event_idevent to listen to
[in]event_cbcallback to call when object send the event (static or c function)
[in]datauser data given to callback when its called
Returns
true if connection was successful, false otherwise
bool EventObject::disconnect_all ( EventObject sender)

Disconnects from all objects sender was listening on.

Parameters
[in]senderobject to be disconnected
Returns
true if disconnection was successful, false otherwise
void EventObject::raise_event ( const CoreString event_id) const

sends an event

Parameters
[in]event_idevent to be sent
void EventObject::raise_event ( const EventInfo event_info) const

sends an event

Parameters
[in]event_infoevent id and custom data to be sent
void EventObject::raise_event ( EventObject sender,
const CoreString event_id 
)
static

Sends an event.

Parameters
[in]senderobject sending the event
[in]event_idevent to be sent
void EventObject::raise_event ( EventObject sender,
const EventInfo event_info 
)
static

Sends an event.

Parameters
[in]senderobject sending the event
[in]event_infoevent id and custom data to be sent