dbus-cxx logo

signal_proxy_base.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 DBUSSIGNALPROXYBASE_H
00020 #define DBUSSIGNALPROXYBASE_H
00021 
00022 #include <dbus-cxx/signal_base.h>
00023 
00024 namespace DBus
00025 {
00033   // TODO fix signals that expect a return value and partially specialize for void returns
00034   
00035   class signal_proxy_base: public signal_base
00036   {
00037     public:
00038 
00039       typedef DBusCxxPointer<signal_proxy_base> pointer;
00040 
00041       signal_proxy_base(const std::string& path, const std::string& interface, const std::string& name);
00042 
00043       signal_proxy_base(const std::string& interface, const std::string& name);
00044 
00045       signal_proxy_base(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
00046 
00047       signal_proxy_base(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
00048 
00049       signal_proxy_base(const signal_proxy_base& other);
00050 
00051       ~signal_proxy_base();
00052 
00053       virtual HandlerResult handle_signal( SignalMessage::const_pointer );
00054 
00055       sigc::signal<HandlerResult,SignalMessage::const_pointer>::accumulated<MessageHandlerAccumulator> signal_dbus_incoming();
00056 
00057       const std::string& match_rule();
00058 
00059       bool matches(Message::const_pointer msg);
00060 
00065       virtual signal_base::pointer clone() = 0;
00066 
00067     protected:
00068 
00069       std::string m_match_rule;
00070 
00071       sigc::signal<HandlerResult,SignalMessage::const_pointer>::accumulated<MessageHandlerAccumulator> m_signal_dbus_incoming;
00072   };
00073 
00074   class signal_proxy_simple: public signal_proxy_base, public sigc::trackable
00075   {
00076     public:
00077 
00078       typedef DBusCxxPointer<signal_proxy_base> pointer;
00079 
00080       signal_proxy_simple(const std::string& path, const std::string& interface, const std::string& name);
00081 
00082       signal_proxy_simple(const std::string& interface, const std::string& name);
00083 
00084       signal_proxy_simple(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
00085 
00086       signal_proxy_simple(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
00087 
00088       signal_proxy_simple(const signal_proxy_simple& other);
00089 
00090       static pointer create(const std::string& path, const std::string& interface, const std::string& name);
00091 
00092       static pointer create(const std::string& interface, const std::string& name);
00093 
00094       static pointer create(DBusCxxPointer<Connection> connection, const std::string& path, const std::string& interface, const std::string& name);
00095 
00096       static pointer create(DBusCxxPointer<Connection> connection, const std::string& interface, const std::string& name);
00097 
00098       static pointer create(const signal_proxy_simple& other);
00099 
00100       ~signal_proxy_simple();
00101 
00106       virtual signal_base::pointer clone();
00107   };
00108 
00109 }
00110 
00111 #endif

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