39 #include <boost/mpl/if.hpp>
40 #include <boost/mpl/list.hpp>
41 #include <boost/mpl/empty.hpp>
42 #include <boost/mpl/front.hpp>
43 #include <boost/mpl/pop_front.hpp>
45 #include "boost/mpl/size.hpp"
49 #ifndef UTIL_ALGEBRA_DEPENDENT_H
50 #define UTIL_ALGEBRA_DEPENDENT_H
64 typedef boost::mpl::list<
94 CPUVariableBlockAlgebra,
120 template <
typename TAlgebra>
123 template <
typename TAlgebra>
129 template <
typename TAlgebra>
140 UG_THROW(
"Cannot provide Algebra type index. Algebra type unknown.");
146 template <
typename List = CompileAlgebraList>
151 static const bool isEmpty = boost::mpl::empty<List>::value;
152 (
typename boost::mpl::if_c<isEmpty, RegEnd, RegNext>::type (atidp));
164 typedef typename boost::mpl::front<List>::type
AlgebraType;
165 typedef typename boost::mpl::pop_front<List>::type NextList;
190 template <
typename Functionality,
typename List = CompileAlgebraList>
195 static const bool isEmpty = boost::mpl::empty<List>::value;
196 typename boost::mpl::if_c<isEmpty, RegEnd, RegNext>::type (reg,grp);
208 typedef typename boost::mpl::front<List>::type
AlgebraType;
209 typedef typename boost::mpl::pop_front<List>::type NextList;
210 Functionality::template Algebra<AlgebraType>(reg,grp);
class describing the type of an algebra
Definition: algebra_type.h:49
Registry for functions and classes that are exported to scripts and visualizations.
Definition: registry.h:138
boost::mpl::list< end_boost_list > CompileAlgebraList
Definition: util_algebra_dependent.h:98
static const size_t NUM_ALGEBRA_TYPES
Definition: util_algebra_dependent.h:101
#define UG_THROW(msg)
Definition: error.h:57
Definition: util_algebra_dependent.h:115
virtual ~AlgebraIDBase()
Definition: util_algebra_dependent.h:117
Definition: util_algebra_dependent.h:121
Definition: util_algebra_dependent.h:156
RegEnd(AlgebraTypeIDProvider &)
Definition: util_algebra_dependent.h:157
Definition: util_algebra_dependent.h:161
RegNext(AlgebraTypeIDProvider &atidp)
Definition: util_algebra_dependent.h:162
Definition: util_algebra_dependent.h:148
RegisterAlgebraIndices(AlgebraTypeIDProvider &atidp)
Definition: util_algebra_dependent.h:149
Definition: util_algebra_dependent.h:105
size_t id()
Definition: util_algebra_dependent.h:130
AlgebraIDBase * m_aid[NUM_ALGEBRA_TYPES]
Definition: util_algebra_dependent.h:185
AlgebraTypeIDProvider()
Definition: util_algebra_dependent.h:173
void reg()
Definition: util_algebra_dependent.h:124
static AlgebraTypeIDProvider & instance()
Definition: util_algebra_dependent.h:107
void operator=(AlgebraTypeIDProvider const &)
AlgebraTypeIDProvider(AlgebraTypeIDProvider const &)
size_t n
Definition: util_algebra_dependent.h:186
Definition: util_algebra_dependent.h:199
RegEnd(Registry ®, std::string grp)
Definition: util_algebra_dependent.h:200
Definition: util_algebra_dependent.h:205
RegNext(Registry ®, std::string grp)
Definition: util_algebra_dependent.h:206
Definition: util_algebra_dependent.h:192
RegisterAlgebraDependent(Registry ®, std::string grp)
Definition: util_algebra_dependent.h:193