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