![]() |
![]() |
Public Types | |
typedef size_t | size_type |
typedef std::list<slot_base> | slot_list |
typedef slot_list::iterator | iterator_type |
typedef slot_list::const_iterator | const_iterator_type |
Public Member Functions | |
signal_impl () | |
void | reference () |
Increments the reference counter. | |
void | reference_exec () |
Increments the reference and execution counter. | |
void | unreference () |
Decrements the reference counter. | |
void | unreference_exec () |
Decrements the reference and execution counter. | |
bool | empty () const |
Returns whether the list of slots is empty. | |
void | clear () |
Empties the list of slots. | |
size_type | size () const |
Returns the number of slots in the list. | |
iterator_type | connect (const slot_base& slot_) |
Adds a slot at the bottom of the list of slots. | |
iterator_type | insert (iterator_type i, const slot_base& slot_) |
Adds a slot at the given position into the list of slots. | |
iterator_type | erase (iterator_type i) |
Removes the slot at the given position from the list of slots. | |
void | sweep () |
Removes invalid slots from the list of slots. | |
Static Public Member Functions | |
static void* | notify (void* d) |
Callback that is executed when some slot becomes invalid. | |
Public Attributes | |
short | ref_count_ |
Reference counter. | |
short | exec_count_ |
Execution counter. | |
bool | deferred_ |
Indicates whether the execution of sweep() is being deferred. | |
std::list<slot_base> | slots_ |
The list of slots. |
signal_impl manages a list of slots. When a slot becomes invalid (because some referred object dies), notify() is executed. notify() either calls sweep() directly or defers the execution of sweep() when the signal is being emitted. sweep() removes all invalid slot from the list.
typedef size_t sigc::internal::signal_impl::size_type |
typedef std::list<slot_base> sigc::internal::signal_impl::slot_list |
sigc::internal::signal_impl::signal_impl | ( | ) |
void sigc::internal::signal_impl::reference | ( | ) | [inline] |
Increments the reference counter.
void sigc::internal::signal_impl::reference_exec | ( | ) | [inline] |
Increments the reference and execution counter.
void sigc::internal::signal_impl::unreference | ( | ) | [inline] |
Decrements the reference counter.
The object is deleted when the reference counter reaches zero.
void sigc::internal::signal_impl::unreference_exec | ( | ) | [inline] |
Decrements the reference and execution counter.
Invokes sweep() if the execution counter reaches zero and the removal of one or more slots has been deferred.
bool sigc::internal::signal_impl::empty | ( | ) | const [inline] |
Returns whether the list of slots is empty.
true
if the list of slots is empty. void sigc::internal::signal_impl::clear | ( | ) |
Empties the list of slots.
size_type sigc::internal::signal_impl::size | ( | ) | const |
Returns the number of slots in the list.
iterator_type sigc::internal::signal_impl::connect | ( | const slot_base& | slot_ | ) |
Adds a slot at the bottom of the list of slots.
slot_ | The slot to add to the list of slots. |
iterator_type sigc::internal::signal_impl::insert | ( | iterator_type | i, | |
const slot_base& | slot_ | |||
) |
Adds a slot at the given position into the list of slots.
i | An iterator indicating the position where slot_ should be inserted. | |
slot_ | The slot to add to the list of slots. |
iterator_type sigc::internal::signal_impl::erase | ( | iterator_type | i | ) |
Removes the slot at the given position from the list of slots.
i | An iterator pointing to the slot to be removed. |
void sigc::internal::signal_impl::sweep | ( | ) |
Removes invalid slots from the list of slots.
static void* sigc::internal::signal_impl::notify | ( | void * | d | ) | [static] |
Callback that is executed when some slot becomes invalid.
This callback is registered in every slot when inserted into the list of slots. It is executed when a slot becomes invalid because of some referred object being destroyed. It either calls sweep() directly or defers the execution of sweep() when the signal is being emitted.
d | The signal object (this ). |
Reference counter.
The object is destroyed when ref_count_ reaches zero.
Execution counter.
Indicates whether the signal is being emitted.
Indicates whether the execution of sweep() is being deferred.
std::list<slot_base> sigc::internal::signal_impl::slots_ |
The list of slots.