00001 #ifndef _SIGX_TUNNEL_VALIDITY_TRACKER_HPP_ 00002 #define _SIGX_TUNNEL_VALIDITY_TRACKER_HPP_ 00003 00004 /* 00005 * Copyright 2008 Klaus Triendl 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Library General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Library General Public 00018 * License along with this library; if not, write to the Free 00019 * Software Foundation, 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #include <sigxconfig.h> 00024 #include <sigx/fwddecl.h> 00025 00026 00027 namespace sigx 00028 { 00029 00030 00034 class SIGX_API tunnel_validity_tracker 00035 { 00036 public: 00037 tunnel_validity_tracker(const shared_dispatchable& _A_disp); 00038 tunnel_validity_tracker(const tunnel_validity_tracker& other); 00039 tunnel_validity_tracker& operator =(const tunnel_validity_tracker& other); 00040 ~tunnel_validity_tracker(); 00041 00042 00050 void do_bind_to_trackable(const sigc::trackable* t) const; 00051 00052 void add_connection(const connection_wrapper& c); 00053 00058 bool is_valid() const; 00059 00063 void activate(); 00064 00065 00066 00077 static void* notify_from_trackable(void* data); 00078 00089 static void notify_dispatcher_change(void* data); 00090 00091 private: 00092 static void clear_connections(internal::validity_trackable* t); 00093 static void cleanup(void* data, bool cleanup_dispatcher); 00094 static void on_last_functor(tunnel_validity_tracker& data); 00095 00096 00097 private: 00098 internal::validity_trackable* m_info; 00099 }; 00100 00101 00102 } // namespace sigx 00103 00104 00105 #endif // end file guard