metaSMT git

metaSMT/Instantiate.hpp

Go to the documentation of this file.
00001 #include "backend/Boolector.hpp"
00002 #include "DirectSolver_Context.hpp"
00003 #include "boost/mpl/list.hpp"
00004 #include "boost/mpl/eval_if.hpp"
00005 
00006 namespace metaSMT {
00007 
00008   struct boolector { 
00009     template <typename> struct result;
00010     
00011     template <typename This, typename Arg>
00012     struct result< This( Arg ) > {
00013       typedef solver::Boolector type;
00014     };
00015 
00016     template<typename Arg> 
00017     DirectSolver_Context< Arg >
00018     operator() (Arg) {
00019       return solver::Boolector();
00020     }
00021   };
00022 
00023   struct group { 
00024     template <typename> struct result;
00025     
00026     template <typename This, typename Arg>
00027     struct result< This( Arg ) > {
00028       typedef Group_Context< Arg > type;
00029     };
00030 
00031     template<typename Arg> 
00032     Group_Context< Arg >
00033     operator() (Arg) {
00034       return Group_Context<Arg>();
00035     }
00036   };
00037 
00038 
00039   struct direct { 
00040     template <typename> struct result;
00041     
00042     template <typename This, typename Arg>
00043     struct result< This( Arg ) > {
00044       typedef DirectSolver_Context< Arg > type;
00045     };
00046 
00047     template<typename Arg> 
00048     DirectSolver_Context< Arg >
00049     operator() (Arg) {
00050       return DirectSolver_Context<Arg>();
00051     }
00052   };
00053 
00054   template<typename A, typename B>
00055   struct construct_helper 
00056   : boost::result_of< A (B) >
00057   { };
00058 
00059   template<typename Parms>
00060   struct Instantiate 
00061   : boost::mpl::reverse_fold<Parms, boost::mpl::void_
00062     , construct_helper<boost::mpl::_2, boost::mpl::_1>
00063   >
00064   { 
00065   };
00066 
00067 } /* metaSMT */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines