20 #include <sigc++/sigc++.h>
22 #ifndef DBUSCXX_SIGNALPROXYBASE_H
23 #define DBUSCXX_SIGNALPROXYBASE_H
50 bool matches( std::shared_ptr<const SignalMessage> msg );
76 template <
typename... T_arg>
85 {
return std::shared_ptr<SignalProxy>(
new SignalProxy( matchRule ) ); }
89 std::tuple<T_arg...> tup_args;
90 std::ostringstream debug_str;
93 debug_str <<
"DBus::signal_proxy<";
94 debug_str << method_sig_gen.debug_string();
95 debug_str <<
">::on_dbus_incoming method=";
96 debug_str << msg->member();
101 std::apply( [i](
auto&& ...arg )
mutable {
102 ( void )( i >> ... >> arg );
105 std::apply( &SignalProxy::emit, std::tuple_cat( std::make_tuple(
this ), tup_args ) );
Extraction iterator allowing values to be retrieved from a message.
Definition: messageiterator.h:56
Base class of all signals(proxy and adapter).
Definition: signalbase.h:35
A special MatchRule for signals.
Definition: matchrule.h:45
Base class for a signal proxy that allows you to listen for signals.
Definition: signalproxy.h:37
bool matches(std::shared_ptr< const SignalMessage > msg)
Definition: signalproxy.cpp:41
SignalProxyBase(const SignalMatchRule &matchRule)
Definition: signalproxy.cpp:22
virtual HandlerResult on_dbus_incoming(std::shared_ptr< const SignalMessage > msg)=0
This method is needed to be able to create a duplicate of a child capable of parsing their specific t...
DBUS_CXX_PROPAGATE_CONST(std::unique_ptr< priv_data >) m_priv
void update_match_rule()
Definition: signalproxy.cpp:57
virtual ~SignalProxyBase()
Definition: signalproxy.cpp:28
virtual HandlerResult handle_signal(std::shared_ptr< const SignalMessage >)
Definition: signalproxy.cpp:31
const std::string & match_rule() const
Definition: signalproxy.cpp:37
SignalProxy(const SignalMatchRule &matchRule)
Definition: signalproxy.h:80
static std::shared_ptr< SignalProxy > create(const SignalMatchRule &matchRule)
Definition: signalproxy.h:84
HandlerResult on_dbus_incoming(std::shared_ptr< const SignalMessage > msg)
Definition: signalproxy.h:88
Definition: signalproxy.h:26
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
HandlerResult
Definition: enums.h:95
@ Not_Handled
This message was not handled for some reason.
@ Handled
This message was handled appropriately.
Definition: utility.h:234