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 
00037   class ObjectPathHandler: public MessageHandler
00038   {
00039     protected:
00040       ObjectPathHandler(const std::string& path, PrimaryFallback pf);
00041 
00042     public:
00043 
00044       typedef DBusCxxPointer<ObjectPathHandler> pointer;
00045 
00046       typedef DBusCxxWeakPointer<ObjectPathHandler> weak_pointer;
00047 
00048       static pointer create(const std::string& path, PrimaryFallback pf=PRIMARY);
00049       
00050       ~ObjectPathHandler();
00051 
00053       const std::string& path();
00054 
00056       PrimaryFallback is_primary_or_fallback();
00057 
00059       DBusCxxPointer<Connection> connection() const;
00060 
00062       virtual bool register_with_connection(DBusCxxPointer<Connection> conn);
00063 
00065       bool unregister(DBusCxxPointer<Connection> conn);
00066 
00068       sigc::signal<void,DBusCxxPointer<Connection> >& signal_registered();
00069 
00073       sigc::signal<void,DBusCxxPointer<Connection> >& signal_unregistered();
00074 
00075     protected:
00076 
00077       DBusCxxPointer<Connection> m_connection;
00078 
00079       std::string m_path;
00080 
00081       PrimaryFallback m_primary_fallback;
00082 
00083       sigc::signal<void,DBusCxxPointer<Connection> > m_signal_registered;
00084 
00085       sigc::signal<void,DBusCxxPointer<Connection> > m_signal_unregistered;
00086 
00087       static struct DBusObjectPathVTable m_dbus_vtable;
00088 
00089       static DBusHandlerResult message_handler_callback(DBusConnection* connection, DBusMessage* message, void* user_data);
00090 
00091       static void path_unregister_callback(DBusConnection* connection, void* user_data);
00092 
00093   };
00094 
00095 }
00096 
00097 #endif

Generated on Thu May 28 16:50:50 2009 for dbus-cxx by doxygen 1.5.7.1