auto_tunneler.h

Go to the documentation of this file.
00001 #ifndef _SIGX_AUTO_TUNNELER_HPP_
00002 #define _SIGX_AUTO_TUNNELER_HPP_
00003 
00004 /*
00005  * Copyright 2005 Tim Mayberry
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/internal_types.h>
00025 #include <sigx/tunnel_functor.h>
00026 
00027 
00028 namespace sigx
00029 {
00030 
00031     namespace internal
00032     {
00033 
00039 template<typename T_functor, 
00040     bool I_istunneled = is_functor_tunneled<T_functor>::value>
00041 struct auto_tunneler
00042 {
00043     static const bool is_tunneled = false;
00044     typedef tunnel_functor<ASYNC, T_functor> functor_type;
00045     static functor_type auto_open_tunnel(const T_functor& _A_func)
00046     {
00047         return open_tunnel(_A_func);
00048     }
00049 };
00050 
00055 template<typename T_functor>
00056 struct auto_tunneler<T_functor, true>
00057 {
00058     static const bool is_tunneled = true;
00059     typedef T_functor functor_type;
00060     static const functor_type& auto_open_tunnel(const T_functor& _A_func)
00061     {
00062         return _A_func;
00063     }
00064 };
00065 
00066 
00067     } // namespace internal
00068 
00069 } // namespace sigx
00070 
00071 
00072 #endif // end file guard

Generated on Wed Jan 28 21:37:59 2009 for sigx++ by  doxygen 1.5.8