sigx++  2.0.1
Public Member Functions | Static Public Member Functions
sigx::tunnel_validity_tracker Class Reference

Interface for tracking the validity of a tunnel. More...

#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_trackeroperator= (const tunnel_validity_tracker &other)
 
 ~tunnel_validity_tracker ()
 
void do_bind_to_trackable (const sigc::trackable *t) const
 Adds a dependency to t. More...
 
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). More...
 
void activate ()
 Activate the validity tracking. More...
 

Static Public Member Functions

static void * notify_from_trackable (void *data)
 This function will be called by the destructor of sigc::trackableS. More...
 
static void notify_dispatcher_change (void *data)
 This function will be called by the dispatchable whenever the dispatcher changes. More...
 

Detailed Description

Interface for tracking the validity of a tunnel.

Constructor & Destructor Documentation

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 ( )

Member Function Documentation

void sigx::tunnel_validity_tracker::activate ( )
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.

Parameters
tThe 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< ASYNC, T_functor >::activate_validity_tracking(), and sigx::tunnel_functor< SYNC, 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).

Returns
true = valid, false = invalid (callback must not be executed)

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.

Parameters
dataHandle 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.

Parameters
dataHandle to the validity info object.

Referenced by do_bind_to_trackable().

tunnel_validity_tracker & sigx::tunnel_validity_tracker::operator= ( const tunnel_validity_tracker other)

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