Main Page Groups Namespaces

# sigc::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > Class Template Reference
[Signals]

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

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

[legend]

List of all members.

## Public Member Functions
| signal ()
| signal (const signal& src)
## Classes
class | accumulated
| Convenience wrapper for the numbered sigc::signal# templates. More...

## 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:

- T_return The desired return type of the emit() function.
- T_arg1 Argument type used in the definition of emit(). The default `nil` means no argument.
- T_arg2 Argument type used in the definition of emit(). The default `nil` means no argument.
- T_arg3 Argument type used in the definition of emit(). The default `nil` means no argument.
- T_arg4 Argument type used in the definition of emit(). The default `nil` means no argument.
- T_arg5 Argument type used in the definition of emit(). The default `nil` means no argument.
- T_arg6 Argument type used in the definition of emit(). The default `nil` means no argument.
- T_arg7 Argument type used in the definition of emit(). The default `nil` means no argument.

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

Example:

         void foo(int) {}
         sigc::signal<void, long> sig;
         sig.connect(sigc::ptr_fun(&foo));
         sig.emit(19);

## Constructor & Destructor Documentation

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>

sigc::signal<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7>::signal | ( |  | ) | `[inline]`

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>

sigc::signal<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7>::signal | ( | const signal<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7>& | src | ) | `[inline]`

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

- signal.h