dbus-cxx logo
objectpathhandler.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_OBJECTPATHHANDLER_H
22 #define DBUSCXX_OBJECTPATHHANDLER_H
23 
24 namespace DBus
25 {
26 
38  class ObjectPathHandler: public MessageHandler
39  {
40  protected:
41  ObjectPathHandler(const std::string& path, PrimaryFallback pf);
42 
43  public:
44 
45  typedef DBusCxxPointer<ObjectPathHandler> pointer;
46 
47  typedef DBusCxxWeakPointer<ObjectPathHandler> weak_pointer;
48 
49  static pointer create(const std::string& path, PrimaryFallback pf=PRIMARY);
50 
51  virtual ~ObjectPathHandler();
52 
54  const Path& path() const;
55 
57  PrimaryFallback is_primary_or_fallback();
58 
60  DBusCxxPointer<Connection> connection() const;
61 
63  virtual bool register_with_connection(DBusCxxPointer<Connection> conn);
64 
66  bool unregister(DBusCxxPointer<Connection> conn);
67 
69  sigc::signal<void,DBusCxxPointer<Connection> >& signal_registered();
70 
74  sigc::signal<void,DBusCxxPointer<Connection> >& signal_unregistered();
75 
76  protected:
77 
78  DBusCxxPointer<Connection> m_connection;
79 
80  Path m_path;
81 
82  PrimaryFallback m_primary_fallback;
83 
84  sigc::signal<void,DBusCxxPointer<Connection> > m_signal_registered;
85 
86  sigc::signal<void,DBusCxxPointer<Connection> > m_signal_unregistered;
87 
88  static struct DBusObjectPathVTable m_dbus_vtable;
89 
90  static DBusHandlerResult message_handler_callback(DBusConnection* connection, DBusMessage* message, void* user_data);
91 
92  static void path_unregister_callback(DBusConnection* connection, void* user_data);
93 
94  };
95 
96 }
97 
98 #endif
Definition: accumulators.h:24
Definition: enums.h:118
PrimaryFallback
Definition: enums.h:116

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