#include <tunnel_validity_tracker.h>
Public Member Functions | |
tunnel_validity_tracker (const shared_dispatchable &_A_disp) | |
tunnel_validity_tracker (const tunnel_validity_tracker &other) | |
tunnel_validity_tracker & | operator= (const tunnel_validity_tracker &other) |
~tunnel_validity_tracker () | |
void | do_bind_to_trackable (const sigc::trackable *t) const |
Adds a dependency to t . | |
void | add_connection (const connection_wrapper &c) |
bool | is_valid () const |
Whether the callback is still valid (all trackables are still alive and dispatcher didn't change). | |
void | activate () |
Activate the validity tracking. | |
Static Public Member Functions | |
static void * | notify_from_trackable (void *data) |
This function will be called by the destructor of sigc::trackableS. | |
static void | notify_dispatcher_change (void *data) |
This function will be called by the dispatchable whenever the dispatcher changes. |
sigx::tunnel_validity_tracker::tunnel_validity_tracker | ( | const shared_dispatchable & | _A_disp | ) |
sigx::tunnel_validity_tracker::tunnel_validity_tracker | ( | const tunnel_validity_tracker & | other | ) |
sigx::tunnel_validity_tracker::~tunnel_validity_tracker | ( | ) |
References sigx::internal::validity_trackable::m_creator_thread, sigx::internal::validity_trackable::m_disp, sigx::internal::validity_trackable::m_dispatcher_change_is_cleanup, sigx::internal::validity_trackable::m_refcount, sigx::internal::validity_trackable::m_tunnel_refcount, and sigx::open_tunnel_with().
Referenced by operator=().
void sigx::tunnel_validity_tracker::activate | ( | ) |
Activate the validity tracking.
References sigx::dispatchable::add_dispatcher_change_notify_callback(), sigx::dispatchable::dispatcher(), sigx::internal::validity_trackable::m_creator_thread, sigx::internal::validity_trackable::m_disp, sigx::internal::validity_trackable::m_dispatcher_change_is_cleanup, sigx::internal::validity_trackable::m_refcount, and notify_dispatcher_change().
void sigx::tunnel_validity_tracker::add_connection | ( | const connection_wrapper & | c | ) |
void sigx::tunnel_validity_tracker::do_bind_to_trackable | ( | const sigc::trackable * | t | ) | const |
Adds a dependency to t
.
Increases the reference count of the validity info object.
t | The trackable object to add a callback to. Must be const because functors might have stored const trackables. |
References sigx::internal::validity_trackable::m_creator_thread, sigx::internal::validity_trackable::m_refcount, sigx::internal::validity_trackable::m_trackables, and notify_from_trackable().
Referenced by sigx::tunnel_functor< SYNC, T_functor >::activate_validity_tracking(), and sigx::tunnel_functor< ASYNC, T_functor >::activate_validity_tracking().
bool sigx::tunnel_validity_tracker::is_valid | ( | ) | const |
Whether the callback is still valid (all trackables are still alive and dispatcher didn't change).
References sigx::internal::validity_trackable::m_valid.
void sigx::tunnel_validity_tracker::notify_dispatcher_change | ( | void * | data | ) | [static] |
This function will be called by the dispatchable whenever the dispatcher changes.
It invalidates the callback associated in a tunnel context. If it was the last object referencing the validity object that notified then notify() destroys the validity info object. It also disconnects eventually the tunnel functor from a signal and notifies the dispatchable associated with the tunnel functor that the tunnel functor is not valid anymore.
data | Handle to the validity info object. |
Referenced by activate().
void * sigx::tunnel_validity_tracker::notify_from_trackable | ( | void * | data | ) | [static] |
This function will be called by the destructor of sigc::trackableS.
It invalidates the callback associated in a tunnel context. If it was the last object referencing the validity object that notified then notify() destroys the validity info object. It also disconnects eventually the tunnel functor from a signal and notifies the dispatchable associated with the tunnel functor that the tunnel functor is not valid anymore.
data | Handle to the validity info object. |
Referenced by do_bind_to_trackable().
tunnel_validity_tracker & sigx::tunnel_validity_tracker::operator= | ( | const tunnel_validity_tracker & | other | ) |