sigx++ 2.0.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
sigx::dispatchable Class Reference

Derived classes designate their ability to dispatch messages over a sigx::dispatcher. More...

#include <dispatchable.h>

Inheritance diagram for sigx::dispatchable:
sigx::noncopyable sigx::auto_dispatchable sigx::manual_dispatchable sigx::shared_dispatchable sigx::glib_auto_dispatchable sigx::threadable sigx::glib_threadable

Public Types

typedef void(* func_dispatcher_change_notify )(void *)

Public Member Functions

void add_dispatcher_change_notify_callback (void *data, func_dispatcher_change_notify func) const
void remove_dispatcher_change_notify_callback (void *data) const

Protected Member Functions

 dispatchable ()
 ~dispatchable () throw ()
void invalidate_tunnels ()
 Invalidate those tunnels (and disconnect them from signals) that have registered themselves with add_dispatcher_change_notify_callback() when the validity tracking was activated.
dispatcher_ptr dispatcher () const throw ()
 non-volatile access to the dispatcher pointer in the current thread

Protected Attributes

internal::rwlockable_dispatcher_ptrm_disp_ptr

Friends

class shared_dispatchable

Detailed Description

Derived classes designate their ability to dispatch messages over a sigx::dispatcher.

This class holds just a thread safe pointer to a dispatcher.


Member Typedef Documentation


Constructor & Destructor Documentation

sigx::dispatchable::dispatchable ( ) [protected]
Exceptions:
Mightthrow a std::bad_alloc exception

References m_disp_ptr.

sigx::dispatchable::~dispatchable ( ) throw () [protected]

Member Function Documentation

void sigx::dispatchable::add_dispatcher_change_notify_callback ( void *  data,
func_dispatcher_change_notify  func 
) const

Add a callback that is executed (notified) when the dispatcher is changed.

Parameters:
dataPassed into func upon notification.
funcCallback executed upon destruction of the object.
Attention:
You must not call dispatchable::remove_dispatcher_change_notify_callback() from within your callback!

Referenced by sigx::tunnel_validity_tracker::activate().

dispatcher_ptr sigx::dispatchable::dispatcher ( ) const throw () [inline, protected]

non-volatile access to the dispatcher pointer in the current thread

Referenced by sigx::tunnel_validity_tracker::activate(), and sigx::manual_dispatchable::~manual_dispatchable().

void sigx::dispatchable::invalidate_tunnels ( ) [protected]

Invalidate those tunnels (and disconnect them from signals) that have registered themselves with add_dispatcher_change_notify_callback() when the validity tracking was activated.

Referenced by sigx::manual_dispatchable::set_dispatcher(), sigx::auto_dispatchable::~auto_dispatchable(), and sigx::manual_dispatchable::~manual_dispatchable().

void sigx::dispatchable::remove_dispatcher_change_notify_callback ( void *  data) const

Remove a callback previously installed with add_dispatcher_change_notify_callback(). The callback is not executed.

Parameters:
dataParameter passed into previous call to add_dispatcher_change_notify_callback().

Friends And Related Function Documentation

friend class shared_dispatchable [friend]

Field Documentation


The documentation for this class was generated from the following files: