dbus-cxx logo
pendingcall.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2007,2008,2009,2010 by Rick L. Vinyard, Jr. *
3  * rvinyard@cs.nmsu.edu *
4  * *
5  * This file is part of the dbus-cxx library. *
6  * *
7  * The dbus-cxx library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License *
9  * version 3 as published by the Free Software Foundation. *
10  * *
11  * The dbus-cxx library is distributed in the hope that it will be *
12  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this software. If not see <http://www.gnu.org/licenses/>. *
18  ***************************************************************************/
19 #include <dbus/dbus.h>
20 #include <sigc++/sigc++.h>
21 #include <dbus-cxx/message.h>
22 #include <dbus-cxx/pointer.h>
23 
24 #ifndef DBUSCXX_PENDING_CALL_H
25 #define DBUSCXX_PENDING_CALL_H
26 
27 namespace DBus
28 {
29 
37  class PendingCall: public sigc::trackable
38  {
39  protected:
40 
41  PendingCall( DBusPendingCall* cobj = NULL );
42 
43  PendingCall( const PendingCall& );
44 
45  public:
46 
47  typedef DBusCxxPointer<PendingCall> pointer;
48 
49  static pointer create( DBusPendingCall* cobj = NULL );
50 
51  static pointer create( const PendingCall& );
52 
53  virtual ~PendingCall();
54 
55  PendingCall& operator=( const PendingCall& other );
56 
57  void cancel();
58 
59  bool completed();
60 
62 
63  void block();
64 
65  sigc::signal<void> signal_notify();
66 
67  DBusPendingCall* cobj();
68 
69  private:
70 
71  DBusPendingCall* m_cobj;
72 
73  sigc::signal<void> m_signal_notify;
74 
75  static void notify_callback( DBusPendingCall* pending, void* data );
76  };
77 
78 }
79 
80 #endif
Message::pointer steal_reply()
Definition: pendingcall.cpp:85
void block()
Definition: pendingcall.cpp:91
Monitors an asynchronous call, emitting a signal when a response is received.
Definition: pendingcall.h:37
PendingCall(DBusPendingCall *cobj=NULL)
Definition: pendingcall.cpp:25
DBusPendingCall * cobj()
DBusCxxPointer< Message > pointer
Definition: message.h:60
Definition: accumulators.h:24
sigc::signal< void > signal_notify()
Definition: pendingcall.cpp:97
static pointer create(DBusPendingCall *cobj=NULL)
Definition: pendingcall.cpp:41
bool completed()
Definition: pendingcall.cpp:78
static void notify_callback(DBusPendingCall *pending, void *data)
Definition: pendingcall.cpp:102
void cancel()
Definition: pendingcall.cpp:72
DBusCxxPointer< PendingCall > pointer
Definition: pendingcall.h:47
sigc::signal< void > m_signal_notify
Definition: pendingcall.h:73
virtual ~PendingCall()
Definition: pendingcall.cpp:51
DBusPendingCall * m_cobj
Definition: pendingcall.h:71
PendingCall & operator=(const PendingCall &other)
Definition: pendingcall.cpp:62

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8