libsigc++ 2.0: sigc::trackable Struct Reference

Main Page Groups Namespaces

# sigc::trackable Struct Reference
[Signals]

Base class for objects with auto-disconnection. More...

Inheritance diagram for sigc::trackable:

[legend]

List of all members.

## Public Member Functions
| trackable ()
| trackable (const trackable& src)
trackable& | operator= (const trackable& src)
| ~trackable ()
## Package Functions
void | add_destroy_notify_callback (void* data, func_destroy_notify func) const
| Add a callback that is executed (notified) when the trackable object is detroyed.
void | remove_destroy_notify_callback (void* data) const
| Remove a callback previously installed with add_destroy_notify_callback().
void | notify_callbacks ()
| Execute and remove all previously installed callbacks.
## Package Attributes
| __pad0__:func_destroy_notify func_destroy_notify

## Detailed Description

Base class for objects with auto-disconnection.

trackable must be inherited when objects shall automatically invalidate slots referring to them on destruction. A slot built from a member function of a trackable derived type installs a callback that is invoked when the trackable object is destroyed or overwritten.

add_destroy_notify_callback() and remove_destroy_notify_callback() can be used to manually install and remove callbacks when notification of the object dying is needed.

notify_callbacks() invokes and removes all previously installed callbacks and can therefore be used to disconnect from all signals.

Note that there is no virtual destructor. Don't use `trackable*` as pointer type for managing your data or the destructors of your derived types won't be called when deleting your objects.

## Constructor & Destructor Documentation

sigc::trackable::trackable | ( |  | ) |

sigc::trackable::trackable | ( | const trackable& | src | ) |

sigc::trackable::~trackable | ( |  | ) |

## Member Function Documentation

trackable& sigc::trackable::operator= | ( | const trackable& | src | ) |

void sigc::trackable::add_destroy_notify_callback | ( | void * | data,
|  | func_destroy_notify | func |
| ) |  |  | const`[package]`

Add a callback that is executed (notified) when the trackable object is detroyed.

Parameters:

  | data | Passed into func upon notification.
  | func | Callback executed upon destruction of the object.

void sigc::trackable::remove_destroy_notify_callback | ( | void * | data | ) | const`[package]`

Remove a callback previously installed with add_destroy_notify_callback().

The callback is not executed.

Parameters:

  | data | Parameter passed into previous call to add_destroy_notify_callback().

void sigc::trackable::notify_callbacks | ( |  | ) | `[package]`

Execute and remove all previously installed callbacks.

## Member Data Documentation

sigc::trackable::__pad0__`[package]`

Reimplemented in sigc::signal0<T_return, T_accumulator>, sigc::signal1<T_return, T_arg1, T_accumulator>, sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>, sigc::signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator>, sigc::signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator>, sigc::signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator>, sigc::signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator>, sigc::signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator>, sigc::signal_base, sigc::signal0<T_return, nil>, sigc::signal1<T_return, T_arg1, nil>, sigc::signal2<T_return, T_arg1, T_arg2, nil>, sigc::signal3<T_return, T_arg1, T_arg2, T_arg3, nil>, sigc::signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, nil>, sigc::signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, nil>, sigc::signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, nil>, and sigc::signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil>.

The documentation for this struct was generated from the following file:

- trackable.h