lockable_fwddecl.h

Go to the documentation of this file.
00001 #ifndef _SIGX_LOCKABLE_FWDDECL_HPP_
00002 #define _SIGX_LOCKABLE_FWDDECL_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 <tr1/type_traits>
00024 
00025 
00026 namespace sigx
00027 {
00028 
00029 //enum locking_policy;
00030 enum locking_policy
00031 {
00032     readlock, 
00033     writelock
00034 };
00035 
00036 template<typename T_mutex, locking_policy I_policy>
00037 struct choose_lock;
00038 
00039 template<typename T_mutex> 
00040 struct lockable_base;
00041 template<typename T_type, typename T_mutex> 
00042 struct lockable;
00043 template<typename T_type, typename T_mutex> 
00044 struct safe_lockable;
00045 
00046 template<locking_policy I_policy, typename T_type, typename T_mutex = typename T_type::mutex_type, typename T_islockable = typename std::tr1::is_base_of<lockable_base<T_mutex>, T_type>::type>
00047 class lock_acquirer;
00048 template<typename T_type, typename T_mutex = typename T_type::mutex_type, typename T_islockable = typename std::tr1::is_base_of<lockable_base<T_mutex>, T_type>::type>
00049 class writelock_acquirer;
00050 template<typename T_type, typename T_mutex = typename T_type::mutex_type, typename T_islockable = typename std::tr1::is_base_of<lockable_base<T_mutex>, T_type>::type>
00051 class readlock_acquirer;
00052 
00053 }
00054 
00055 
00056 #endif  // end file guard

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