libzypp
17.22.0
signals.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\----------------------------------------------------------------------/
9
*
10
* This file contains private API, this might break at any time between releases.
11
* You have been warned!
12
*
13
*/
14
#ifndef ZYPP_NG_BASE_SIGNALS_H_INCLUDED
15
#define ZYPP_NG_BASE_SIGNALS_H_INCLUDED
16
17
#include <sigc++/trackable.h>
18
#include <sigc++/signal.h>
19
#include <sigc++/connection.h>
20
21
namespace
zyppng
{
22
23
using
sigc::signal;
24
using
sigc::connection;
25
using
sigc::trackable;
26
27
template
<
class
R,
class
... T>
28
class
SignalProxy
;
29
35
template
<
class
R,
class
... T>
36
class
SignalProxy
<R(T...)>
37
{
38
public
:
39
using
SlotType
= sigc::slot<R(T...)>;
40
using
SignalType
= sigc::signal<R(T...)>;
41
42
SignalProxy
(
SignalType
&sig ) : _sig ( sig ) {}
43
51
connection
connect
(
const
SlotType
& slot )
52
{
53
return
_sig.connect( slot );
54
}
55
59
connection
connect
(
SlotType
&& slot )
60
{
61
return
_sig.connect( std::move( slot ) );
62
}
63
64
private
:
65
SignalType
&
_sig
;
66
};
67
68
69
}
70
71
#endif // ZYPP_NG_CORE_SIGNALS_H_INCLUDED
zyppng::SignalProxy< R(T...)>::SignalType
sigc::signal< R(T...)> SignalType
Definition:
signals.h:40
zyppng::SignalProxy< R(T...)>::connect
connection connect(const SlotType &slot)
Connects a signal handler to a signal.
Definition:
signals.h:51
zyppng::SignalProxy
Definition:
signals.h:28
zyppng::SignalProxy< R(T...)>::_sig
SignalType & _sig
Definition:
signals.h:65
zyppng::SignalProxy< R(T...)>::SlotType
sigc::slot< R(T...)> SlotType
Definition:
signals.h:39
zyppng::SignalProxy< R(T...)>::SignalProxy
SignalProxy(SignalType &sig)
Definition:
signals.h:42
zyppng
Definition:
abstracteventsource.cc:8
zyppng::SignalProxy< R(T...)>::connect
connection connect(SlotType &&slot)
Connects a signal handler to a signal.
Definition:
signals.h:59
zypp
zyppng
base
signals.h
Generated by
1.8.16