dbus-cxx logo
signalreceiver.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  ***************************************************************************/
20 
21 #ifndef DBUSCXX_SIGNALRECEIVER_H
22 #define DBUSCXX_SIGNALRECEIVER_H
23 
24 namespace DBus
25 {
26 
44  {
45  protected:
46  SignalReceiver(const std::string& path, const std::string& interface, const std::string& member);
47 
48  public:
49 
50  typedef DBusCxxPointer<SignalReceiver> pointer;
51 
52  typedef DBusCxxWeakPointer<SignalReceiver> weak_pointer;
53 
54  static pointer create(const std::string& interface, const std::string& member);
55 
56  static pointer create(const std::string& path, const std::string& interface, const std::string& member);
57 
59 
60  virtual HandlerResult handle_message( DBusCxxPointer<Connection>, Message::const_pointer );
61 
62  const std::string& sender();
63 
64  void set_sender(const std::string& s);
65 
66  const std::string& interface();
67 
68  void set_interface(const std::string& s);
69 
70  const std::string& member();
71 
72  void set_member(const std::string& s);
73 
74  const Path& path();
75 
76  void set_path(const std::string& s);
77 
78  const std::string& destination();
79 
80  void set_destination(const std::string& s);
81 
82  sigc::signal<void>& signal_sender_changed();
83 
84  sigc::signal<void>& signal_interface_changed();
85 
86  sigc::signal<void>& signal_member_changed();
87 
88  sigc::signal<void>& signal_path_changed();
89 
90  sigc::signal<void>& signal_destination_changed();
91 
92  const std::string& match_rule();
93 
95 
96  protected:
97 
98  std::string m_sender;
99 
101 
102  std::string m_interface;
103 
104  std::string m_member;
105 
106  std::string m_destination;
107 
108  sigc::signal<void> m_signal_sender_changed;
109 
110  sigc::signal<void> m_signal_interface_changed;
111 
112  sigc::signal<void> m_signal_member_changed;
113 
114  sigc::signal<void> m_signal_path_changed;
115 
116  sigc::signal<void> m_signal_destination_changed;
117 
118  std::string m_match_rule;
119 
120  };
121 
122 }
123 
124 #endif
sigc::signal< void > m_signal_destination_changed
Definition: signalreceiver.h:116
const std::string & destination()
Definition: signalreceiver.cpp:102
~SignalReceiver()
Definition: signalreceiver.cpp:45
This class serves as a receiver of incoming signal messages.
Definition: signalreceiver.h:43
HandlerResult
Definition: enums.h:87
void set_sender(const std::string &s)
Definition: signalreceiver.cpp:63
std::string m_interface
Definition: signalreceiver.h:102
sigc::signal< void > m_signal_member_changed
Definition: signalreceiver.h:112
Definition: accumulators.h:24
const std::string & match_rule()
Definition: signalreceiver.cpp:138
This class provides a common base class for all message handlers.
Definition: messagehandler.h:40
SignalReceiver(const std::string &path, const std::string &interface, const std::string &member)
Definition: signalreceiver.cpp:27
std::string m_sender
Definition: signalreceiver.h:98
void set_member(const std::string &s)
Definition: signalreceiver.cpp:85
sigc::signal< void > m_signal_interface_changed
Definition: signalreceiver.h:110
sigc::signal< void > & signal_member_changed()
Definition: signalreceiver.cpp:123
std::string m_destination
Definition: signalreceiver.h:106
virtual HandlerResult handle_message(DBusCxxPointer< Connection >, Message::const_pointer)
Definition: signalreceiver.cpp:49
std::string m_match_rule
Definition: signalreceiver.h:118
const std::string & sender()
Definition: signalreceiver.cpp:58
static pointer create(const std::string &interface, const std::string &member)
Definition: signalreceiver.cpp:35
void set_destination(const std::string &s)
Definition: signalreceiver.cpp:107
const std::string & interface()
Definition: signalreceiver.cpp:69
sigc::signal< void > & signal_path_changed()
Definition: signalreceiver.cpp:128
sigc::signal< void > & signal_interface_changed()
Definition: signalreceiver.cpp:118
Definition: path.h:31
const std::string & member()
Definition: signalreceiver.cpp:80
void set_interface(const std::string &s)
Definition: signalreceiver.cpp:74
sigc::signal< void > m_signal_path_changed
Definition: signalreceiver.h:114
void set_path(const std::string &s)
Definition: signalreceiver.cpp:96
const Path & path()
Definition: signalreceiver.cpp:91
bool matches(Message::const_pointer msg)
Definition: signalreceiver.cpp:154
std::string m_member
Definition: signalreceiver.h:104
sigc::signal< void > & signal_destination_changed()
Definition: signalreceiver.cpp:133
sigc::signal< void > m_signal_sender_changed
Definition: signalreceiver.h:108
DBusCxxPointer< const Message > const_pointer
Definition: message.h:62
Path m_path
Definition: signalreceiver.h:100
DBusCxxPointer< SignalReceiver > pointer
Definition: signalreceiver.h:50
DBusCxxWeakPointer< SignalReceiver > weak_pointer
Definition: signalreceiver.h:52
sigc::signal< void > & signal_sender_changed()
Definition: signalreceiver.cpp:113

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