16 #ifndef polybori_common_common_traits_h_
17 #define polybori_common_common_traits_h_
26 #include <boost/preprocessor/cat.hpp>
27 #include <boost/preprocessor/seq/for_each.hpp>
28 #include <boost/preprocessor/facilities/expand.hpp>
29 #include <boost/preprocessor/stringize.hpp>
40 template <class ValueType>
100 template <
class ValueType>
105 template <
class ValueType>
116 template <
class FirstType,
class SecondType>
119 template <
class OnlyType>
125 template <
class FirstType,
class SecondType>
133 template <
class MgrType>
136 template <
class CuddLike>
160 #define PB_DECLARE_CUDD_TYPES(fromspace) \
161 typedef fromspace::errorfunc_type errorfunc_type; \
162 typedef fromspace::large_size_type large_size_type; \
163 typedef fromspace::refcount_type refcount_type; \
164 typedef fromspace::node_type node_type; \
165 typedef fromspace::mgrcore_type mgrcore_type; \
166 typedef fromspace::unary_int_function unary_int_function; \
167 typedef fromspace::void_function void_function; \
168 typedef fromspace::binary_function binary_function; \
169 typedef fromspace::binary_int_function binary_int_function; \
170 typedef fromspace::ternary_function ternary_function; \
171 typedef fromspace::int_unary_function int_unary_function; \
172 typedef fromspace::size_type size_type;\
173 typedef fromspace::idx_type idx_type;
176 #define PB_BINARY_FUNC_CALL(count, funcname, arg_pair) \
177 BOOST_PP_EXPAND(funcname(BOOST_PP_SEQ_HEAD(arg_pair), \
178 BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(arg_pair))))
180 template<
unsigned ErrorNumber>
190 #define PB_CUDD_ERROR_TRAITS(errcode, errstr) \
191 template<> inline cudd_error_traits<errcode>::result_type \
192 cudd_error_traits<errcode>::operator()() const { \
193 return BOOST_PP_STRINGIZE(errstr); }
196 ((CUDD_MEMORY_OUT)(Out of memory.))
197 ((CUDD_TOO_MANY_NODES)(Too many nodes.))
198 ((CUDD_MAX_MEM_EXCEEDED)(Maximum memory exceeded.))
199 ((CUDD_INVALID_ARG)(Invalid argument.))
200 ((CUDD_INTERNAL_ERROR)(Internal error.))
201 ((CUDD_NO_ERROR)(Unexpected error.))
204 #undef PB_CUDD_ERROR_TRAITS