Sacado_mpl_apply_wrap.hpp

Go to the documentation of this file.
00001 // $Id$ 
00002 // $Source$ 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 //                           Sacado Package
00007 //                 Copyright (2006) Sandia Corporation
00008 // 
00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00010 // the U.S. Government retains certain rights in this software.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
00027 // (etphipp@sandia.gov).
00028 // 
00029 // ***********************************************************************
00030 // @HEADER
00031 
00032 #ifndef SACADO_MPL_APPLY_WRAP_HPP
00033 #define SACADO_MPL_APPLY_WRAP_HPP
00034 
00035 #include "Sacado_mpl_none.hpp"
00036 
00037 namespace Sacado {
00038 
00039   namespace mpl {
00040 
00041     // wrapper to call a metafunction class
00042     template <class F> struct 
00043     apply_wrap0 {
00044       typedef typename F::apply::type type;
00045     };
00046 
00047     template <class F, 
00048               class A1> 
00049     struct apply_wrap1 {
00050       typedef typename F::template apply<A1>::type type;
00051     };
00052 
00053     template <class F, 
00054               class A1, 
00055               class A2> 
00056     struct apply_wrap2 {
00057       typedef typename F::template apply<A1,A2>::type type;
00058     };
00059 
00060     template <class F, 
00061               class A1, 
00062               class A2, 
00063               class A3> 
00064     struct apply_wrap3 {
00065       typedef typename F::template apply<A1,A2,A3>::type type;
00066     };
00067 
00068     template <class F, 
00069               class A1, 
00070               class A2, 
00071               class A3,
00072               class A4> 
00073     struct apply_wrap4 {
00074       typedef typename F::template apply<A1,A2,A3,A4>::type type;
00075     };
00076 
00077     template <class F, 
00078               class A1, 
00079               class A2, 
00080               class A3,
00081               class A4,
00082               class A5> 
00083     struct apply_wrap5 {
00084       typedef typename F::template apply<A1,A2,A3,A4,A5>::type type;
00085     };
00086 
00087     template <class F, 
00088               class A1, 
00089               class A2, 
00090               class A3,
00091               class A4,
00092               class A5>
00093     struct apply_wrap : 
00094       apply_wrap5<F,A1,A2,A3,A4,A5> {};
00095 
00096     template <class F, 
00097               class A1, 
00098               class A2, 
00099               class A3,
00100               class A4>
00101     struct apply_wrap<F,A1,A2,A3,A4,mpl::none> : 
00102       apply_wrap4<F,A1,A2,A3,A4> {};
00103 
00104     template <class F, 
00105               class A1, 
00106               class A2, 
00107               class A3>
00108     struct apply_wrap<F,A1,A2,A3,mpl::none,mpl::none> : 
00109       apply_wrap3<F,A1,A2,A3> {};
00110 
00111     template <class F, 
00112               class A1, 
00113               class A2>
00114     struct apply_wrap<F,A1,A2,mpl::none,mpl::none,mpl::none> : 
00115       apply_wrap2<F,A1,A2> {};
00116 
00117     template <class F, 
00118               class A1>
00119     struct apply_wrap<F,A1,mpl::none,mpl::none,mpl::none,mpl::none> : 
00120       apply_wrap1<F,A1> {};
00121 
00122     template <class F>
00123     struct apply_wrap<F,mpl::none,mpl::none,mpl::none,mpl::none,mpl::none> : 
00124       apply_wrap0<F> {};
00125     
00126   } // namespace mpl
00127 
00128 } // namespace Sacado
00129 
00130 #endif // SACADO_APPLY_TYPE_WRAP_HPP

Generated on Wed May 12 21:39:35 2010 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.4.7