dbus-cxx logo
signal_proxy_base.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2009,2010 by Rick L. Vinyard, Jr. *
3  * rvinyard@cs.nmsu.edu *
4  * *
5  * This file is part of the dbus-cxx library. *
6  * *
7  * The dbus-cxx library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License *
9  * version 3 as published by the Free Software Foundation. *
10  * *
11  * The dbus-cxx library is distributed in the hope that it will be *
12  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this software. If not see <http://www.gnu.org/licenses/>. *
18  ***************************************************************************/
19 #include <dbus-cxx/signal_base.h>
20 
21 #ifndef DBUSCXX_SIGNALPROXYBASE_H
22 #define DBUSCXX_SIGNALPROXYBASE_H
23 
24 namespace DBus
25 {
33  // TODO fix signals that expect a return value and partially specialize for void returns
34 
36  {
37  public:
38 
39  typedef DBusCxxPointer<signal_proxy_base> pointer;
40 
41  signal_proxy_base(const std::string& path, const std::string& interface, const std::string& name);
42 
43  signal_proxy_base(const std::string& interface, const std::string& name);
44 
45  signal_proxy_base(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
46 
47  signal_proxy_base(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
48 
50 
51  virtual ~signal_proxy_base();
52 
54 
55  sigc::signal<HandlerResult,SignalMessage::const_pointer>::accumulated<MessageHandlerAccumulator> signal_dbus_incoming();
56 
57  const std::string& match_rule();
58 
60 
65  virtual signal_base::pointer clone() = 0;
66 
67  protected:
68 
69  std::string m_match_rule;
70 
71  sigc::signal<HandlerResult,SignalMessage::const_pointer>::accumulated<MessageHandlerAccumulator> m_signal_dbus_incoming;
72  };
73 
74  class signal_proxy_simple: public signal_proxy_base, public sigc::trackable
75  {
76  public:
77 
78  typedef DBusCxxPointer<signal_proxy_base> pointer;
79 
80  signal_proxy_simple(const std::string& path, const std::string& interface, const std::string& name);
81 
82  signal_proxy_simple(const std::string& interface, const std::string& name);
83 
84  signal_proxy_simple(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
85 
86  signal_proxy_simple(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
87 
89 
90  static pointer create(const std::string& path, const std::string& interface, const std::string& name);
91 
92  static pointer create(const std::string& interface, const std::string& name);
93 
94  static pointer create(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
95 
96  static pointer create(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
97 
98  static pointer create(const signal_proxy_simple& other);
99 
100  virtual ~signal_proxy_simple();
101 
106  virtual signal_base::pointer clone();
107  };
108 
109 }
110 
111 #endif
This accumulator will try each slot and stop when the first slot returns HANDLED. ...
Definition: accumulators.h:76
virtual ~signal_proxy_base()
Definition: signal_proxy_base.cpp:51
HandlerResult
Definition: enums.h:87
DBusCxxPointer< const SignalMessage > const_pointer
Definition: signalmessage.h:56
const std::string & name() const
Definition: signal_base.cpp:99
static pointer create(const std::string &path, const std::string &interface, const std::string &name)
Definition: signal_proxy_base.cpp:132
Definition: accumulators.h:24
DBusCxxPointer< Connection > connection()
Definition: signal_base.cpp:69
signal_proxy_simple(const std::string &path, const std::string &interface, const std::string &name)
Definition: signal_proxy_base.cpp:106
DBusCxxPointer< signal_proxy_base > pointer
Definition: signal_proxy_base.h:78
DBusCxxPointer< signal_base > pointer
Definition: signal_base.h:64
virtual signal_base::pointer clone()=0
This method is needed to be able to create a duplicate of a child capable of parsing their specific t...
std::string m_match_rule
Definition: signal_proxy_base.h:69
Definition: signal_base.h:48
virtual signal_base::pointer clone()
This method is needed to be able to create a duplicate of a child capable of parsing their specific t...
Definition: signal_proxy_base.cpp:161
sigc::signal< HandlerResult, SignalMessage::const_pointer >::accumulated< MessageHandlerAccumulator > m_signal_dbus_incoming
Definition: signal_proxy_base.h:71
virtual HandlerResult handle_signal(SignalMessage::const_pointer)
Definition: signal_proxy_base.cpp:55
DBusCxxPointer< signal_proxy_base > pointer
Definition: signal_proxy_base.h:39
bool matches(Message::const_pointer msg)
Definition: signal_proxy_base.cpp:82
const std::string & match_rule()
Definition: signal_proxy_base.cpp:67
sigc::signal< HandlerResult, SignalMessage::const_pointer >::accumulated< MessageHandlerAccumulator > signal_dbus_incoming()
Definition: signal_proxy_base.cpp:62
signal_proxy_base(const std::string &path, const std::string &interface, const std::string &name)
Definition: signal_proxy_base.cpp:25
Definition: signal_proxy_base.h:74
virtual ~signal_proxy_simple()
Definition: signal_proxy_base.cpp:157
const std::string & interface() const
Definition: signal_base.cpp:89
DBusCxxPointer< const Message > const_pointer
Definition: message.h:62
const Path & path() const
Definition: signal_base.cpp:109
Definition: signal_proxy_base.h:35

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8