14 #ifndef DBUSCXX_DBUS_SIGNAL_H_
15 #define DBUSCXX_DBUS_SIGNAL_H_
19 template <
typename... T_sig>
22 template <
typename T_ret,
typename... T_args>
39 template <
typename... T_type>
41 :
public sigc::signal<void( T_type... )>,
public SignalBase {
43 Signal(
const std::string& path,
const std::string& interface_name,
const std::string& member ):
45 m_internal_callback_connection =
46 this->connect( sigc::mem_fun( *
this, &Signal::internal_callback ) );
50 static std::shared_ptr<Signal>
create(
const std::string& path,
const std::string& interface_name,
const std::string& member ) {
51 return std::shared_ptr<Signal>(
new Signal( path, interface_name, member ) );
60 virtual std::string
introspect(
int space_depth = 0 )
const {
61 std::ostringstream sout;
65 for(
int i = 0; i < space_depth; i++ ) { spaces +=
" "; }
67 sout << spaces <<
"<signal name=\"" << name() <<
"\">\n";
68 sout << spaces << method_sig_gen.introspect( m_arg_names, 0, spaces );
69 sout << spaces <<
"</signal>\n";
74 if( i < m_arg_names.size() ) {
return m_arg_names[i]; }
80 if( i < m_arg_names.size() ) {
81 m_arg_names[i] = name;
98 << __msg->interface_name()
100 << __msg->member() );
102 if( !destination().empty() ) { __msg->set_destination( destination() ); }
104 ( *__msg << ... << args );
105 bool result = this->handle_dbus_outgoing( __msg );
An Interface represents a local copy of a DBus interface.
Definition: interface.h:41
Base class of all signals(proxy and adapter).
Definition: signalbase.h:35
static std::shared_ptr< SignalMessage > create()
Definition: signalmessage.cpp:31
virtual void set_arg_name(size_t i, const std::string &name)
Definition: signal.h:79
virtual std::string arg_name(size_t i)
Definition: signal.h:73
sigc::connection m_internal_callback_connection
Definition: signal.h:91
Signal(const std::string &path, const std::string &interface_name, const std::string &member)
Definition: signal.h:43
std::vector< std::string > m_arg_names
Definition: signal.h:89
void internal_callback(T_type... args)
Definition: signal.h:93
static std::shared_ptr< Signal > create(const std::string &path, const std::string &interface_name, const std::string &member)
Definition: signal.h:50
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: signal.h:60
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
Definition: utility.h:234