Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Signal2< R, P1, P2, Marshal > Class Template Reference

A template for a signal passing two arguments of type P1 and P2, and returning a value of type R. More...

`#include <inti/signals.h>`

Inheritance diagram for Inti::Signal2< R, P1, P2, Marshal >:

List of all members.

## Public Types

- typedef Slot2< R, P1, P2 > SlotType
    Function signature for handlers connecting to the signal.

## Public Member Functions

- Connection connect (const SlotType *slot)
    Connect a slot to the signal.
- SlotType * slot ()
    Returns a slot for this signal.
- R emit (P1 p1, P2 p2)
    Emit the signal.
- R operator() (P1 p1, P2 p2)
    Function operator; calls emit().

## Detailed Description

### template<typename R, typename P1, typename P2, typename Marshal = DefaultMarshal<R>>
class Inti::Signal2< R, P1, P2, Marshal >

A template for a signal passing two arguments of type P1 and P2, and returning a value of type R.

## Member Function Documentation

template<typename R, typename P1, typename P2, typename Marshal = DefaultMarshal<R>>
Connection Inti::Signal2< R, P1, P2, Marshal >::connect | ( | const SlotType * | slot | ) | `[inline]`

Connect a slot to the signal.

Parameters:

  slot | A slot of type Slot2<R, P1, P2>.

Returns:
  A connection object.

The returned connection object can be used alter or change the connection.

template<typename R, typename P1, typename P2, typename Marshal = DefaultMarshal<R>>
R Inti::Signal2< R, P1, P2, Marshal >::emit | ( | P1 | p1,
|  | P2 | p2
| ) | `[inline]`

Emit the signal.

Parameters:

  p1 | Passes p1 to the signal handler.
  p2 | Passes p2 to the signal handler.

Returns:
  The value returned by the signal handler.

Calls every slot connected to this signal, in order of connection.

template<typename R, typename P1, typename P2, typename Marshal = DefaultMarshal<R>>
SlotType* Inti::Signal2< R, P1, P2, Marshal >::slot | ( |  | ) | `[inline]`

Returns a slot for this signal.

Returns:
  A new slot of type Slot2<R, P1, P2>.

The returned slot can be passed to another signal allowing the other signal to call this signal when it gets emitted.

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

- signals.h

Main Page - Footer