watch.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <dbus/dbus.h>
00020 #include <dbus-cxx/pointer.h>
00021
00022 #ifndef DBUSCXX_WATCH_H
00023 #define DBUSCXX_WATCH_H
00024
00025 namespace DBus
00026 {
00027
00038 class Watch
00039 {
00040 protected:
00041 Watch( DBusWatch* cobj = NULL );
00042
00043 public:
00044
00045 typedef DBusCxxPointer<Watch> pointer;
00046 typedef DBusCxxWeakPointer<Watch> weak_pointer;
00047
00048 static pointer create( DBusWatch* cobj = NULL );
00049
00050 ~Watch();
00051
00052 bool is_valid() const;
00053
00054 operator bool() const;
00055
00056 int unix_fd() const;
00057
00058 int socket() const;
00059
00060 unsigned int flags() const;
00061
00062 bool is_readable() const;
00063
00064 bool is_writable() const;
00065
00066 bool is_enabled() const;
00067
00068 bool handle( unsigned int flags );
00069
00070 bool handle_read( bool error=false, bool hangup=false );
00071
00072 bool handle_write( bool error=false, bool hangup=false );
00073
00074 bool handle_readwrite( bool error = false, bool hangup = false );
00075
00076 DBusWatch* cobj();
00077
00078 const DBusWatch* cobj() const;
00079
00080 operator DBusWatch*();
00081
00082 protected:
00083 DBusWatch* m_cobj;
00084 };
00085
00086 }
00087
00088 #endif