![]() |
![]() |
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.
|
|
|
|
|
|
|
|
|
|
|
Empties the list of slots.
|
|
Adds a slot at the bottom of the list of slots.
|
|
Returns whether the list of slots is empty.
|
|
Removes the slot at the given position from the list of slots.
|
|
Adds a slot at the given position into the list of slots.
|
|
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.
|
|
Increments the reference counter.
|
|
Increments the reference and execution counter.
|
|
Returns the number of slots in the list.
|
|
Removes invalid slots from the list of slots.
|
|
Decrements the reference counter. The object is deleted when the reference counter reaches zero. |
|
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. |
|
Indicates whether the execution of sweep() is being deferred.
|
|
Execution counter. Indicates whether the signal is being emitted. |
|
Reference counter. The object is destroyed when ref_count_ reaches zero. |
|
The list of slots.
|