objectpathhandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <dbus-cxx/messagehandler.h>
00020
00021 #ifndef DBUSCXX_OBJECTPATHHANDLER_H
00022 #define DBUSCXX_OBJECTPATHHANDLER_H
00023
00024 namespace DBus
00025 {
00026
00038 class ObjectPathHandler: public MessageHandler
00039 {
00040 protected:
00041 ObjectPathHandler(const std::string& path, PrimaryFallback pf);
00042
00043 public:
00044
00045 typedef DBusCxxPointer<ObjectPathHandler> pointer;
00046
00047 typedef DBusCxxWeakPointer<ObjectPathHandler> weak_pointer;
00048
00049 static pointer create(const std::string& path, PrimaryFallback pf=PRIMARY);
00050
00051 virtual ~ObjectPathHandler();
00052
00054 const Path& path() const;
00055
00057 PrimaryFallback is_primary_or_fallback();
00058
00060 DBusCxxPointer<Connection> connection() const;
00061
00063 virtual bool register_with_connection(DBusCxxPointer<Connection> conn);
00064
00066 bool unregister(DBusCxxPointer<Connection> conn);
00067
00069 sigc::signal<void,DBusCxxPointer<Connection> >& signal_registered();
00070
00074 sigc::signal<void,DBusCxxPointer<Connection> >& signal_unregistered();
00075
00076 protected:
00077
00078 DBusCxxPointer<Connection> m_connection;
00079
00080 Path m_path;
00081
00082 PrimaryFallback m_primary_fallback;
00083
00084 sigc::signal<void,DBusCxxPointer<Connection> > m_signal_registered;
00085
00086 sigc::signal<void,DBusCxxPointer<Connection> > m_signal_unregistered;
00087
00088 static struct DBusObjectPathVTable m_dbus_vtable;
00089
00090 static DBusHandlerResult message_handler_callback(DBusConnection* connection, DBusMessage* message, void* user_data);
00091
00092 static void path_unregister_callback(DBusConnection* connection, void* user_data);
00093
00094 };
00095
00096 }
00097
00098 #endif