dbus-cxx logo

objectpathhandler.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2009,2010 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 #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

Generated on Thu Mar 18 09:30:55 2010 for dbus-cxx by doxygen 1.6.1