164 # include <cuddObj.hh>
166 #ifndef pbori_defs_h_
167 #define pbori_defs_h_
171 #define LIKELY(expression) (__builtin_expect(!!(expression), 1))
172 #define UNLIKELY(expression) (__builtin_expect(!!(expression), 0))
174 #define LIKELY(expression) (expression)
175 #define UNLIKELY(expression) (expression)
179 #define PBORINAME polybori
182 #ifndef PBORI_NO_DEVELOPER
183 # define PBORI_DEVELOPER
186 #ifndef PBORI_NO_NAMESPACES
189 # define BEGIN_NAMESPACE_PBORI namespace PBORINAME {
192 # define END_NAMESPACE_PBORI } // end of namespace
195 # define USING_NAMESPACE_PBORI using namespace PBORINAME;
198 # define PBORI PBORINAME
201 # define USING_PBORI using PBORI
204 # define PBORI_BEGIN_NAMESPACE( sub_space ) namespace sub_space {
207 # define PBORI_END_NAMESPACE }
211 # define BEGIN_NAMESPACE_PBORI
212 # define END_NAMESPACE_PBORI
213 # define USING_NAMESPACE_PBORI
216 # define PBORI_BEGIN_NAMESPACE( sub_space )
217 # define PBORI_END_NAMESPACE
219 #endif // PBORI_NO_NAMESPACES
222 #ifdef PBORI_DEBUG_TRACE
224 # define PBORI_TRACE_FUNC(text) std::cerr << text << std::endl;
226 # define PBORI_TRACE_FUNC(text)
230 #ifndef PBORI_NO_STDSTREAMS
233 # define PBORI_OSTREAM std::ostream
242 template <
class StreamedType>
249 #endif // of #ifndef PBORI_NO_STDSTREAMS
252 #ifndef PBORI_NO_BOOST_PTR
254 # include <boost/shared_ptr.hpp>
255 # define PBORI_SHARED_PTR(Type) boost::shared_ptr<Type>
260 template <
class ValueType>
279 template <
class ValueType>
280 class pbori_shared_ptr {
284 typedef ValueType value_type;
287 typedef pbori_shared_ptr<value_type>
self;
291 pbori_shared_ptr(value_type* pRhs = NULL):
292 pVal(pRhs), is_shared(pRhs == NULL) {}
295 pbori_shared_ptr(
const self& rhs):
296 pVal(rhs.pVal), is_shared(true) {}
299 ~pbori_shared_ptr(){
if (!is_shared)
delete pVal; }
302 self& operator=(
const self& rhs) {
303 pVal = rhs.pVal; is_shared =
true;
309 value_type* operator->(){
return pVal; }
310 const value_type* operator->()
const {
return pVal; }
312 const value_type&
operator*()
const {
return *pVal; }
313 bool operator==(
const self& rhs)
const {
return (pVal==rhs.pVal); }
314 operator bool()
const {
return pVal != NULL; }
318 bool unique()
const {
return !is_shared; }
329 # define PBORI_SHARED_PTR(Type) PBORI::pbori_shared_ptr<Type>
333 template <
class ValueType>
337 if( lhs.unique() && (lhs == rhs) )
343 #endif // of #ifndef PBORI_NO_BOOST_PTR
349 template <
class DDType>
353 template <
class ManType>
407 less_or_equal_max = 0,
408 greater_or_equal_min = 0
411 enum { max_idx = CUDD_MAXINDEX };
507 static
idx_type max_index() {
return CCompareEnums::max_idx; }
512 #ifdef PBORI_DEVELOPER
513 # define PBORI_NOT_IMPLEMENTED \
514 throw PBORI::PBoRiError(PBORI::CTypes::not_implemented);
516 # define PBORI_NOT_IMPLEMENTED
520 #if defined(PBORI_ADD_BY_ITE) || defined(PBORI_ADD_BY_OR) \
521 || defined(PBORI_ADD_BY_UNION) || defined(PBORI_ADD_BY_EXTRA_XOR) \
522 || defined(PBORI_ADD_BY_XOR)
524 # define PBORI_ADD_BY_XOR
529 #ifdef PBORI_ADD_BY_XOR
530 # define PBORI_LOWLEVEL_XOR
534 #if defined(PBORI_USEDVARS_BY_IDX) || defined(PBORI_USEDVARS_BY_TRANSFORM) \
535 || defined(PBORI_USEDVARS_HIGHLEVEL)|| defined(PBORI_USEDVARS_BY_SUPPORT)\
536 || defined(PBORI_USEDVARS_EXTRA)
538 # define PBORI_USEDVARS_BY_IDX
542 #endif // of #ifndef pbori_defs_h_