Main Page Groups Namespaces

# sigc::signal2< T_return, T_arg1, T_arg2, T_accumulator > Class Template Reference
[Signals]

Signal declaration. More...

Inheritance diagram for sigc::signal2< T_return, T_arg1, T_arg2, T_accumulator >:

[legend]

List of all members.

## Package Types
typedef emitter_type::result_type | result_type
typedef slot < T_return, T_arg1, T_arg2 > | slot_type
typedef slot_list <slot_type> | slot_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
## Package Functions
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) const
| Triggers the emission of the signal.
result_type | operator() (typename type_trait<T_arg1>::take _A_a1, typename type_trait<T_arg2>::take _A_a2) const
| Triggers the emission of the signal (see emit()).
bound_const_mem_functor2 < result_type, signal2, typename type_trait<T_arg1> ::take, typename type_trait<T_arg2> ::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.
| signal2 ()
| signal2 (const signal2& src)
## Package Attributes
| __pad0__:signal_emit2<T_return
| T_arg1
| T_arg2
T_accumulator | emitter_type

## Detailed Description

### template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>
class sigc::signal2< T_return, T_arg1, T_arg2, T_accumulator >

Signal declaration.

signal2 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 implicitely.

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 following template arguments are used:

- T_return The desired return type for the emit() function (may be overridden by the accumulator).
- T_arg1 Argument type used in the definition of emit().
- T_arg2 Argument type used in the definition of emit().
- T_accumulator The accumulator type used for emission. The default `nil` means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.

You should use the more convenient unnumbered sigc::signal template.

## Member Typedef Documentation

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef emitter_type::result_type sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::result_type`[package]`

Reimplemented in SigC::Signal2<T_return, T_arg1, T_arg2, T_accumulator>.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef slot<T_return, T_arg1,T_arg2> sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::slot_type`[package]`

Reimplemented in SigC::Signal2<T_return, T_arg1, T_arg2, T_accumulator>.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef slot_list<slot_type> sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::slot_list_type`[package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef slot_list_type::iterator sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::iterator`[package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef slot_list_type::const_iterator sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::const_iterator`[package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef slot_list_type::reverse_iterator sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::reverse_iterator`[package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

typedef slot_list_type::const_reverse_iterator sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::const_reverse_iterator`[package]`

## Constructor & Destructor Documentation

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::signal2 | ( |  | ) | `[inline, package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::signal2 | ( | const signal2<T_return, T_arg1, T_arg2, T_accumulator>& | src | ) | `[inline, package]`

## Member Function Documentation

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

iterator sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::connect | ( | const slot_type& | slot_ | ) | `[inline, package]`

Add a slot to the list of slots.

Any functor or slot may be passed into connect(). It will be converted into a slot implicitely. The returned iterator may be stored for disconnection of the slot at some later point. It stays valid until the slot is removed from the list of slots. The iterator can also be implicitely converted into a sigc::connection object that may be used safely beyond the life time of the slot.

Parameters:

  | slot_ | The slot to add to the list of slots.

Returns:
  An iterator pointing to the new slot in the list.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

result_type sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::emit | ( | typename type_trait<T_arg1>::take | _A_a1,
|  | typename type_trait<T_arg2>::take | _A_a2 |
| ) |  |  | const`[inline, package]`

Triggers the emission of the signal.

During signal emission all slots that have been connected to the signal are invoked unless they are manually set into a blocking state. The parameters are passed on to the slots. If T_accumulated is not `nil`, an accumulator of this type is used to process the return values of the slot invocations. Otherwise, the return value of the last slot invoked is returned.

Parameters:

  | _A_a1 | Argument to be passed on to the slots.
  | _A_a2 | Argument to be passed on to the slots.

Returns:
  The accumulated return values of the slot invocations.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

result_type sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::operator() | ( | typename type_trait<T_arg1>::take | _A_a1,
|  | typename type_trait<T_arg2>::take | _A_a2 |
| ) |  |  | const`[inline, package]`

Triggers the emission of the signal (see emit()).

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

bound_const_mem_functor2<result_type, signal2, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take> sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::make_slot | ( |  | ) | const`[inline, package]`

Creates a functor that calls emit() on this signal.

     sigc::mem_fun(mysignal, &sigc::signal2::emit)

yields the same result.

Returns:
  A functor that calls emit() on this signal.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

slot_list_type sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::slots | ( |  | ) | `[inline, package]`

Creates an STL-style interface for the signal's list of slots.

This interface supports iteration, insertion and removal of slots.

Returns:
  An STL-style interface for the signal's list of slots.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

const slot_list_type sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::slots | ( |  | ) | const`[inline, package]`

Creates an STL-style interface for the signal's list of slots.

This interface supports iteration, insertion and removal of slots.

Returns:
  An STL-style interface for the signal's list of slots.

## Member Data Documentation

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::__pad0__`[package]`

Reimplemented from sigc::signal_base.

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::T_arg1`[package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::T_arg2`[package]`

template <class T_return, class T_arg1, class T_arg2, class T_accumulator = nil>

T_accumulator sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator>::emitter_type`[package]`

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

- signal.h