connection_wrapper.h
Go to the documentation of this file.00001 #ifndef _SIGX_CONNECTION_HPP_
00002 #define _SIGX_CONNECTION_HPP_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <tr1/memory>
00024 #include <sigxconfig.h>
00025 #include <sigx/fwddecl.h>
00026 #include <sigx/shared_dispatchable.h>
00027
00028
00029 namespace sigx
00030 {
00031
00035 class SIGX_API connection_wrapper
00036 {
00037 private:
00038
00039
00040
00041
00042
00043
00044
00045
00046 typedef std::tr1::shared_ptr<const volatile sigc_connection_ptr> shared_sigc_conn_ptr;
00047
00048
00049 public:
00052 connection_wrapper();
00056 connection_wrapper(const shared_dispatchable& _A_disp, const shared_sigc_conn_ptr& _A_conn);
00059 connection_wrapper(const connection_wrapper& other) throw();
00060
00064 ~connection_wrapper() throw();
00065
00068 connection_wrapper& operator =(const connection_wrapper& other);
00069
00070
00071 public:
00075 bool empty() const;
00076
00080 bool connected() const;
00081
00085 bool blocked() const;
00086
00090 bool block(bool should_block = true);
00091
00095 bool unblock();
00096
00100 void disconnect();
00101
00106 operator bool();
00107
00108 protected:
00109 void destroy_self();
00110
00111
00112 private:
00114 shared_sigc_conn_ptr m_sigc_conn;
00117 shared_dispatchable m_shared_disp;
00119 volatile int* m_sigcconn_refcount;
00120 };
00121
00122
00123 }
00124
00125
00126 #endif // end file guard