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>
148 typedef node_type (*unary_int_function)(mgrcore_type, int);
149 typedef node_type (*void_function)(mgrcore_type);
152 typedef node_type (*binary_int_function)(mgrcore_type, node_type, int);
154 node_type (*ternary_function)(mgrcore_type, node_type, node_type, node_type);
156 typedef int (*int_unary_function)(mgrcore_type, node_type);
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>
184 result_type operator()()
const;
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
#define PBORI_PREFIX(name)
Definition: prefix.h:27
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
DdManager * mgrcore_type
Definition: traits.h:146
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
This class contains property definitions to be used in polybori classes.
Definition: traits.h:41
CTypes::idx_type idx_type
Definition: traits.h:142
value_type::bool_type bool_type
Type for standard true/false statements.
Definition: traits.h:54
value_type::comp_type comp_type
Type for comparisons.
Definition: traits.h:66
OnlyType::easy_equality_property easy_equality_property
Definition: traits.h:122
DD_CTFP binary_function
Definition: traits.h:151
value_type::ostream_type ostream_type
Type for out-stream.
Definition: traits.h:72
value_type::hash_type hash_type
Type for hashing.
Definition: traits.h:69
DdNode * node_type
Definition: traits.h:145
value_type::easy_equality_property easy_equality_property
The property whether the equality check is easy.
Definition: traits.h:75
ValueType value_type
Definition: traits.h:47
#define PB_BINARY_FUNC_CALL(count, funcname, arg_pair)
Definition: traits.h:176
unsigned long large_size_type
Definition: traits.h:139
pbori_DdManager DdManager
Definition: traits.h:33
long int refcount_type
Definition: traits.h:140
value_type::idx_type idx_type
Type for indices.
Definition: traits.h:63
int idx_type
Type for indices.
Definition: pbori_defs.h:228
CTypes::size_type size_type
Definition: traits.h:143
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
std::size_t size_type
Type for lengths, dimensions, etc.
Definition: pbori_defs.h:219
value_type::size_type size_type
Type for lengths, dimensions, etc.
Definition: traits.h:57
#define PB_CUDD_ERROR_TRAITS(errcode, errstr)
Definition: traits.h:190
This struct contains type definitions to be used in library classes.
Definition: pbori_defs.h:269
value_type::integer_type integer_type
Type for integer numbers.
Definition: traits.h:60
This class contains property definitions related to two types to be used in polybori classes...
Definition: traits.h:117
const char * result_type
Definition: traits.h:182