logo top
Main Page   Groups   Namespaces  

sigc::internal::signal_impl Struct Reference

Implementation of the signal interface. More...

List of all members.

Public Types

typedef size_t size_type
typedef std::list<slot_baseslot_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_baseslots_
 The list of slots.


Detailed Description

Implementation of the signal interface.

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.


Member Typedef Documentation

typedef slot_list::const_iterator sigc::internal::signal_impl::const_iterator_type
 

typedef slot_list::iterator sigc::internal::signal_impl::iterator_type
 

typedef size_t sigc::internal::signal_impl::size_type
 

typedef std::list<slot_base> sigc::internal::signal_impl::slot_list
 


Constructor & Destructor Documentation

sigc::internal::signal_impl::signal_impl (  ) 
 


Member Function Documentation

void sigc::internal::signal_impl::clear (  ) 
 

Empties the list of slots.

iterator_type sigc::internal::signal_impl::connect ( const slot_base slot_  ) 
 

Adds a slot at the bottom of the list of slots.

Parameters:
slot_ The slot to add to the list of slots.
Returns:
An iterator pointing to the new slot in the list.

bool sigc::internal::signal_impl::empty (  )  const [inline]
 

Returns whether the list of slots is empty.

Returns:
true if the list of slots is empty.

iterator_type sigc::internal::signal_impl::erase ( iterator_type  i  ) 
 

Removes the slot at the given position from the list of slots.

Parameters:
i An iterator pointing to the slot to be removed.
Returns:
An iterator pointing to the slot in the list after the one removed.

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.

Parameters:
i An iterator indicating the position where slot_ should be inserted.
slot_ The slot to add to the list of slots.
Returns:
An iterator pointing to the new slot in the list.

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.

Parameters:
d The signal object (this).

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.

size_type sigc::internal::signal_impl::size (  )  const
 

Returns the number of slots in the list.

Returns:
The number of slots in the list.

void sigc::internal::signal_impl::sweep (  ) 
 

Removes invalid slots from the list of slots.

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.


Member Data Documentation

bool sigc::internal::signal_impl::deferred_
 

Indicates whether the execution of sweep() is being deferred.

short sigc::internal::signal_impl::exec_count_
 

Execution counter.

Indicates whether the signal is being emitted.

short sigc::internal::signal_impl::ref_count_
 

Reference counter.

The object is destroyed when ref_count_ reaches zero.

std::list<slot_base> sigc::internal::signal_impl::slots_
 

The list of slots.


The documentation for this struct was generated from the following file:
Generated for libsigc++ 2.0 by Doxygen 1.4.5 © 1997-2001