dbus-cxx logo
signal_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 <string>
20 
21 #include <sigc++/sigc++.h>
22 
23 #include <dbus-cxx/enums.h>
24 #include <dbus-cxx/pointer.h>
25 #include <dbus-cxx/accumulators.h>
26 #include <dbus-cxx/signalmessage.h>
27 
28 #ifndef DBUSCXX_SIGNALBASE_H
29 #define DBUSCXX_SIGNALBASE_H
30 
31 namespace DBus
32 {
33  class Connection;
34 
46  // TODO fix signals that expect a return value and partially specialize for void returns
47 
49  {
50  protected:
51 
52  signal_base(const std::string& path, const std::string& interface, const std::string& name);
53 
54  signal_base(const std::string& interface, const std::string& name);
55 
56  signal_base(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
57 
58  signal_base(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
59 
60  signal_base(const signal_base& other);
61 
62  public:
63 
64  typedef DBusCxxPointer<signal_base> pointer;
65 
66  virtual ~signal_base();
67 
68  DBusCxxPointer<Connection> connection();
69 
70  void set_connection(DBusCxxPointer<Connection> connection);
71 
72  const std::string& sender() const;
73 
74  void set_sender(const std::string& s);
75 
76  const std::string& interface() const;
77 
78  void set_interface(const std::string& i);
79 
80  const std::string& name() const;
81 
82  void set_name( const std::string& n );
83 
84  const Path& path() const;
85 
86  void set_path(const std::string& s);
87 
88  const std::string& destination() const;
89 
90  void set_destination(const std::string& s);
91 
96  virtual pointer clone() = 0;
97 
99  virtual std::string introspect(int space_depth=0) const { return std::string(); }
100 
101  virtual std::string arg_name(size_t i) { return std::string(); }
102 
103  virtual void set_arg_name(size_t i, const std::string& name) { }
104 
105  protected:
106 
107  DBusCxxWeakPointer<Connection> m_connection;
108 
109  std::string m_sender;
110 
112 
113  std::string m_interface;
114 
115  std::string m_name;
116 
117  std::string m_destination;
118 
119  std::string m_match_rule;
120 
122  };
123 
124 }
125 
126 #endif
Path m_path
Definition: signal_base.h:111
std::string m_match_rule
Definition: signal_base.h:119
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: signal_base.h:99
const std::string & destination() const
Definition: signal_base.cpp:119
void set_connection(DBusCxxPointer< Connection > connection)
Definition: signal_base.cpp:74
const std::string & name() const
Definition: signal_base.cpp:99
Definition: accumulators.h:24
DBusCxxWeakPointer< Connection > m_connection
Definition: signal_base.h:107
DBusCxxPointer< Connection > connection()
Definition: signal_base.cpp:69
const std::string & sender() const
Definition: signal_base.cpp:79
std::string m_destination
Definition: signal_base.h:117
bool handle_dbus_outgoing(Message::const_pointer)
Definition: signal_base.cpp:129
std::string m_interface
Definition: signal_base.h:113
std::string m_sender
Definition: signal_base.h:109
DBusCxxPointer< signal_base > pointer
Definition: signal_base.h:64
virtual void set_arg_name(size_t i, const std::string &name)
Definition: signal_base.h:103
virtual pointer clone()=0
This method is needed to be able to create a duplicate of a child capable of parsing their specific t...
virtual ~signal_base()
Definition: signal_base.cpp:65
void set_name(const std::string &n)
Definition: signal_base.cpp:104
std::string m_name
Definition: signal_base.h:115
virtual std::string arg_name(size_t i)
Definition: signal_base.h:101
Definition: signal_base.h:48
void set_sender(const std::string &s)
Definition: signal_base.cpp:84
signal_base(const std::string &path, const std::string &interface, const std::string &name)
Definition: signal_base.cpp:28
Definition: path.h:31
void set_interface(const std::string &i)
Definition: signal_base.cpp:94
const std::string & interface() const
Definition: signal_base.cpp:89
DBusCxxPointer< const Message > const_pointer
Definition: message.h:62
void set_path(const std::string &s)
Definition: signal_base.cpp:114
const Path & path() const
Definition: signal_base.cpp:109
void set_destination(const std::string &s)
Definition: signal_base.cpp:124

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