dbus-cxx logo

objectpathhandler.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2009 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the dbus-cxx library.                            *
00006  *                                                                         *
00007  *   The dbus-cxx library is free software; you can redistribute it and/or *
00008  *   modify it under the terms of the GNU General Public License           *
00009  *   version 3 as published by the Free Software Foundation.               *
00010  *                                                                         *
00011  *   The dbus-cxx library is distributed in the hope that it will be       *
00012  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty   *
00013  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014  *   General Public License for more details.                              *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this software. If not see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 #ifndef DBUSOBJECTPATHHANDLER_H
00020 #define DBUSOBJECTPATHHANDLER_H
00021 
00022 #include <dbus-cxx/messagehandler.h>
00023 
00024 namespace DBus
00025 {
00026 
00027   class Connection;
00028 
00040   class ObjectPathHandler: public MessageHandler
00041   {
00042     protected:
00043       ObjectPathHandler(const std::string& path, PrimaryFallback pf);
00044 
00045     public:
00046 
00047       typedef DBusCxxPointer<ObjectPathHandler> pointer;
00048 
00049       typedef DBusCxxWeakPointer<ObjectPathHandler> weak_pointer;
00050 
00051       static pointer create(const std::string& path, PrimaryFallback pf=PRIMARY);
00052       
00053       ~ObjectPathHandler();
00054 
00056       const Path& path() const;
00057 
00059       PrimaryFallback is_primary_or_fallback();
00060 
00062       DBusCxxPointer<Connection> connection() const;
00063 
00065       virtual bool register_with_connection(DBusCxxPointer<Connection> conn);
00066 
00068       bool unregister(DBusCxxPointer<Connection> conn);
00069 
00071       sigc::signal<void,DBusCxxPointer<Connection> >& signal_registered();
00072 
00076       sigc::signal<void,DBusCxxPointer<Connection> >& signal_unregistered();
00077 
00078     protected:
00079 
00080       DBusCxxPointer<Connection> m_connection;
00081 
00082       Path m_path;
00083 
00084       PrimaryFallback m_primary_fallback;
00085 
00086       sigc::signal<void,DBusCxxPointer<Connection> > m_signal_registered;
00087 
00088       sigc::signal<void,DBusCxxPointer<Connection> > m_signal_unregistered;
00089 
00090       static struct DBusObjectPathVTable m_dbus_vtable;
00091 
00092       static DBusHandlerResult message_handler_callback(DBusConnection* connection, DBusMessage* message, void* user_data);
00093 
00094       static void path_unregister_callback(DBusConnection* connection, void* user_data);
00095 
00096   };
00097 
00098 }
00099 
00100 #endif

Generated on Fri Jun 26 15:50:38 2009 for dbus-cxx by doxygen 1.5.8