"Fossies" - the Fresh Open Source Software archive

Member "libsigc++-2.3.1/docs/reference/html/classsigc_1_1signal.html" (18 Oct 2012, 41313 Bytes) of package /linux/misc/libsigc++-2.3.1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted raw source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

libsigc++  2.3.1
Classes | Public Member Functions | List of all members
sigc::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > Class Template Reference

Convenience wrapper for the numbered sigc::signal# templates. More...

#include <sigc++/signal.h>

Inheritance diagram for sigc::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >:
Inheritance graph
[legend]

Classes

class  accumulated
 Convenience wrapper for the numbered sigc::signal# templates. More...
 

Public Member Functions

 signal (const signal& src)
 
- Public Member Functions inherited from sigc::signal7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil >
iterator connect (const slot_type& slot_)
 Add a slot to the list of slots.
 
result_type emit (typename type_trait< T_arg1 >::take _A_a1, typename type_trait< T_arg2 >::take _A_a2, typename type_trait< T_arg3 >::take _A_a3, typename type_trait< T_arg4 >::take _A_a4, typename type_trait< T_arg5 >::take _A_a5, typename type_trait< T_arg6 >::take _A_a6, typename type_trait< T_arg7 >::take _A_a7) const
 Triggers the emission of the signal.
 
result_type emit_reverse (typename type_trait< T_arg1 >::take _A_a1, typename type_trait< T_arg2 >::take _A_a2, typename type_trait< T_arg3 >::take _A_a3, typename type_trait< T_arg4 >::take _A_a4, typename type_trait< T_arg5 >::take _A_a5, typename type_trait< T_arg6 >::take _A_a6, typename type_trait< T_arg7 >::take _A_a7) const
 Triggers the emission of the signal in reverse order (see emit()).
 
result_type operator() (typename type_trait< T_arg1 >::take _A_a1, typename type_trait< T_arg2 >::take _A_a2, typename type_trait< T_arg3 >::take _A_a3, typename type_trait< T_arg4 >::take _A_a4, typename type_trait< T_arg5 >::take _A_a5, typename type_trait< T_arg6 >::take _A_a6, typename type_trait< T_arg7 >::take _A_a7) const
 Triggers the emission of the signal (see emit()).
 
bound_const_mem_functor7
< result_type, signal7,
typename type_trait< T_arg1 >
::take, typename type_trait
< T_arg2 >::take, typename
type_trait< T_arg3 >::take,
typename type_trait< T_arg4 >
::take, typename type_trait
< T_arg5 >::take, typename
type_trait< T_arg6 >::take,
typename type_trait< T_arg7 >
::take > 
make_slot () const
 Creates a functor that calls emit() on this signal.
 
slot_list_type slots ()
 Creates an STL-style interface for the signal's list of slots.
 
const slot_list_type slots () const
 Creates an STL-style interface for the signal's list of slots.
 
 signal7 (const signal7& src)
 
- Public Member Functions inherited from sigc::signal_base
 signal_base (const signal_base& src)
 
signal_baseoperator= (const signal_base& src)
 
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.
 
bool blocked () const
 Returns whether all slots in the list are blocked.
 
void block (bool should_block=true)
 Sets the blocking state of all slots in the list.
 
void unblock ()
 Unsets the blocking state of all slots in the list.
 
- Public Member Functions inherited from sigc::trackable
 trackable (const trackable& src)
 
trackableoperator= (const trackable& src)
 
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.
 

Additional Inherited Members

- Public Types inherited from sigc::signal7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, nil >
typedef internal::signal_emit7
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6,
T_arg7, nil > 
emitter_type
 
typedef emitter_type::result_type result_type
 
typedef slot< T_return, T_arg1,
T_arg2, T_arg3, T_arg4, T_arg5,
T_arg6, T_arg7 > 
slot_type
 
typedef slot_list< slot_typeslot_list_type
 
typedef slot_list_type::iterator iterator
 
typedef
slot_list_type::const_iterator 
const_iterator
 
typedef
slot_list_type::reverse_iterator 
reverse_iterator
 
typedef
slot_list_type::const_reverse_iterator 
const_reverse_iterator
 
- Protected Types inherited from sigc::signal_base
typedef
internal::signal_impl::iterator_type 
iterator_type
 
- Protected Member Functions inherited from sigc::signal_base
iterator_type connect (const slot_base& slot_)
 Adds a slot at the end 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.
 
internal::signal_impl* impl () const
 Returns the signal_impl object encapsulating the list of slots.
 
- Protected Attributes inherited from sigc::signal_base
internal::signal_impl* impl_
 The signal_impl object encapsulating the slot list.
 

Detailed Description

template<class T_return, class T_arg1 = nil, class T_arg2 = nil, class T_arg3 = nil, class T_arg4 = nil, class T_arg5 = nil, class T_arg6 = nil, class T_arg7 = nil>
class sigc::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >

Convenience wrapper for the numbered sigc::signal# templates.

signal can be used to connect() slots that are invoked during subsequent calls to emit(). Any functor or slot can be passed into connect(). It is converted into a slot implicitly.

If you want to connect one signal to another, use make_slot() to retrieve a functor that emits the signal when invoked.

Be careful if you directly pass one signal into the connect() method of another: a shallow copy of the signal is made and the signal's slots are not disconnected until both the signal and its clone are destroyed, which is probably not what you want!

An STL-style list interface for the signal's list of slots can be retrieved with slots(). This interface supports iteration, insertion and removal of slots.

The template arguments determine the function signature of the emit() function:

To specify an accumulator type the nested class signal::accumulated can be used.

Example:
void foo(int) {}
sig.emit(19);