CCuddCore.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_ring_CCuddCore_h
#define polybori_ring_CCuddCore_h
// include basic definitions
#include <polybori/pbori_defs.h>
#include "CCuddInterface.h"
#include "CVariableNames.h"
// get PolyBoRi routines and functionals
#include <polybori/routines/pbori_func.h>
#include <polybori/common/traits.h>
// intrisive (shared) pointer functionality
#include <boost/intrusive_ptr.hpp>
#include <vector>
#include <boost/shared_ptr.hpp>
BEGIN_NAMESPACE_PBORI
class COrderingBase;
class CCuddCore:
public CTypes::orderenums_type, public CAuxTypes,
public CWeakPtrFacade<CCuddCore> {
public:
typedef CCuddCore self;
typedef CVariableNames variable_names_type;
typedef variable_names_type::const_reference const_varname_reference;
CCuddInterface m_mgr;
typedef COrderingBase order_type;
typedef boost::shared_ptr<order_type> order_ptr;
typedef order_type& order_reference;
typedef CTypes::ordercode_type ordercode_type;
refcount_type ref;
variable_names_type m_names;
order_ptr pOrder;
CCuddCore(size_type numVarsZ, const order_ptr& order):
m_mgr(0, numVarsZ), ref(0), m_names(numVarsZ),
pOrder(order) { }
CCuddCore(const self& rhs):
m_mgr(rhs.m_mgr), ref(0), m_names(rhs.m_names), pOrder(rhs.pOrder) { }
~CCuddCore(){ }
void addRef(){ ++ref; }
refcount_type release() {
return (--ref);
}
void change_ordering(const order_ptr& newOrder) {
pOrder = newOrder;
}
};
inline void
intrusive_ptr_add_ref(CCuddCore* pCore){
pCore->addRef();
}
inline void
intrusive_ptr_release(CCuddCore* pCore) {
if (!(pCore->release())) {
delete pCore;
}
}
END_NAMESPACE_PBORI
#endif
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
polybori::CVariableNames::const_reference
vartext_type const_reference
Define type for outputing variable names.
Definition: CVariableNames.h:52
polybori::CCuddCore::const_varname_reference
variable_names_type::const_reference const_varname_reference
Define type for getting names of variables.
Definition: CCuddCore.h:63
polybori::CCuddCore::CCuddCore
CCuddCore(size_type numVarsZ, const order_ptr &order)
Initialize raw decision diagram management.
Definition: CCuddCore.h:92
polybori::CCuddCore::addRef
void addRef()
Increment reference count.
Definition: CCuddCore.h:105
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
polybori::CCuddCore::variable_names_type
CVariableNames variable_names_type
Define type for storing names of variables.
Definition: CCuddCore.h:60
polybori::COrderEnums
This struct contains type definitions and enumerations to be used for order codes.
Definition: pbori_defs.h:152
polybori::CCuddCore::m_names
variable_names_type m_names
Stores names of variables.
Definition: CCuddCore.h:84
traits.h
polybori::COrderingBase
Definition: COrderingBase.h:43
pbori_func.h
polybori::CAuxTypes
This struct contains auxiliary type definitions.
Definition: pbori_defs.h:210
polybori::CCuddInterface
This class defines a C++ interface to CUDD's decicion diagram manager.
Definition: CCuddInterface.h:111
polybori::CCuddCore
This class prepares the CUDD's raw decision diagram manager structure for the use with instrinsive po...
Definition: CCuddCore.h:50
intrusive_ptr_release
void intrusive_ptr_release(pbori_DdManager *ptr)
Release current pointer by decrementing reference counting.
Definition: CCuddInterface.h:73
polybori::CVariableNames
Definition: CVariableNames.h:30
pbori_defs.h
polybori::CCuddCore::order_reference
order_type & order_reference
Reference for handling mterm orderings.
Definition: CCuddCore.h:75
polybori::CCuddCore::release
refcount_type release()
Release this by decrementing reference counting.
Definition: CCuddCore.h:108
polybori::CCuddCore::CCuddCore
CCuddCore(const self &rhs)
Definition: CCuddCore.h:98
polybori::CCuddCore::order_type
COrderingBase order_type
Type for handling mterm orderings.
Definition: CCuddCore.h:69
polybori::CCuddCore::~CCuddCore
~CCuddCore()
Destructor.
Definition: CCuddCore.h:102
polybori::CCuddCore::ordercode_type
CTypes::ordercode_type ordercode_type
Enum for ordering codes.
Definition: CCuddCore.h:78
polybori::CCuddCore::pOrder
order_ptr pOrder
*Ordering of *this
Definition: CCuddCore.h:88
polybori::CWeakPtrFacade
This class defines CWeakPtrFacade.
Definition: CWeakPtrFacade.h:36
CCuddInterface.h
polybori::CCuddCore::change_ordering
void change_ordering(const order_ptr &newOrder)
Definition: CCuddCore.h:112
polybori::CAuxTypes::size_type
std::size_t size_type
Type for lengths, dimensions, etc.
Definition: pbori_defs.h:219
polybori::CCuddCore::order_ptr
boost::shared_ptr< order_type > order_ptr
Smart pointer for handling mterm orderings.
Definition: CCuddCore.h:72
CVariableNames.h
intrusive_ptr_add_ref
void intrusive_ptr_add_ref(pbori_DdManager *ptr)
Increment reference count.
Definition: CCuddInterface.h:67
polybori::CCuddCore::ref
refcount_type ref
Count instances pointing here.
Definition: CCuddCore.h:81
polybori::CAuxTypes::ordercode_type
int ordercode_type
Type for ordering codes.
Definition: pbori_defs.h:240
polybori::CCuddCore::m_mgr
CCuddInterface m_mgr
Current decision diagram management.
Definition: CCuddCore.h:66