arg_info.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 * Copyright (c) 2001 - 2008 Marcus Boerger.  All rights reserved.
00003 *
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of the GNU Lesser General Public
00006 * License as published by the Free Software Foundation; either
00007 * version 2.1 of the License, or (at your option) any later version.
00008 *
00009 * This library is distributed in the hope that it will be useful,
00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 * Lesser General Public License for more details.
00013 *
00014 * You should have received a copy of the GNU Lesser General Public
00015 * License along with this library; if not, write to the Free Software
00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017 * ========================================================================= */
00018 
00019 /* ------------------------------------------------------------------------ */
00020 /* Name:      arg_info.h
00021  *
00022  * Requires:  
00023  * - Mbo.h
00024  */
00035 /* ------------------------------------------------------------------------ */
00036 
00037 #pragma once
00038 
00039 #ifndef _ARG_INFO_H_
00040 #define _ARG_INFO_H_
00041 
00042 namespace mbo
00043 {
00044 
00045 /****************************************************************************/
00046 
00049 template<typename _Targ, typename _Tvar = _Targ>
00050 struct arg_info
00051 {
00052     typedef _Targ    argument_t;
00053     typedef _Targ    variable_t;
00054 };
00055 
00058 template<typename _Targ, typename _Tvar>
00059 struct arg_info<_Targ*, _Tvar*>
00060 {
00061     typedef _Targ*   argument_t;
00062     typedef _Tvar*   variable_t;
00063 };
00064 
00067 template<typename _Targ, typename _Tvar>
00068 struct arg_info<_Targ&, _Tvar&>
00069 {
00070     typedef _Targ&   argument_t;
00071     typedef _Tvar&   variable_t;
00072 };
00073 
00076 template<>
00077 struct arg_info<void, void>
00078 {
00079     typedef void     argument_t;
00080     typedef void     variable_t;
00081 };
00082 
00085 template<typename _Targ, typename _Tvar = _Targ>
00086 struct const_arg_info: arg_info<const _Targ, const _Tvar>
00087 {
00088 };
00089 
00092 template<typename _Type>
00093 struct copy_arg_info: arg_info<_Type, _Type>
00094 {
00095 };
00096 
00099 template<typename _Type>
00100 struct copy_arg_info<_Type*>: arg_info<const _Type*, _Type*>
00101 {
00102 };
00103 
00106 template<typename _Type>
00107 struct copy_arg_info<_Type&>: arg_info<const _Type&, _Type>
00108 {
00109 };
00110 
00113 template<typename _Type>
00114 struct copy_arg_info<const _Type*>: arg_info<const _Type*, const _Type*>
00115 {
00116 };
00117 
00120 template<typename _Type>
00121 struct copy_arg_info<const _Type&>: arg_info<const _Type&, const _Type&>
00122 {
00123 };
00124 
00125 }; // namespace
00126 
00127 #endif // _ARG_INFO_H_

  Hosted on code.google.com  
© Marcus Börger
Generated on Fri Jan 18 21:21:07 2008 for MBO-lib by doxygen 1.5.4