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/message.h> 00020 00021 #ifndef DBUSCXX_SIGNALMESSAGE_H 00022 #define DBUSCXX_SIGNALMESSAGE_H 00023 00024 namespace DBus 00025 { 00026 00038 class SignalMessage : public Message 00039 { 00040 protected: 00041 00042 SignalMessage( DBusMessage* cobj=NULL, CreateMethod m = CREATE_ALIAS ); 00043 00044 SignalMessage( Message::pointer msg ); 00045 00046 SignalMessage( Message::const_pointer msg ); 00047 00048 SignalMessage( const std::string& name ); 00049 00050 SignalMessage( const std::string& path, const std::string& interface, const std::string& name ); 00051 00052 public: 00053 00054 typedef DBusCxxPointer<SignalMessage> pointer; 00055 00056 typedef DBusCxxPointer<const SignalMessage> const_pointer; 00057 00058 typedef DBusCxxWeakPointer<SignalMessage> weak_pointer; 00059 00060 static pointer create( DBusMessage* cobj=NULL, CreateMethod m = CREATE_ALIAS ); 00061 00062 static pointer create( Message::pointer msg ); 00063 00064 static const_pointer create( Message::const_pointer msg ); 00065 00066 static pointer create( const std::string& name ); 00067 00068 static pointer create( const std::string& path, const std::string& interface, const std::string& name ); 00069 00070 bool set_path( const std::string& p ); 00071 00072 Path path() const; 00073 00074 bool has_path( const std::string& p ) const; 00075 00076 std::vector<std::string> path_decomposed() const; 00077 00078 bool set_interface( const std::string& i ); 00079 00080 const char* interface() const; 00081 00082 bool has_interface( const std::string& i ) const; 00083 00084 bool set_member( const std::string& m ); 00085 00086 const char* member() const; 00087 00088 bool has_member( const std::string& m ) const; 00089 00090 bool operator == ( const SignalMessage& ) const; 00091 00092 }; 00093 00094 } 00095 00096 #endif