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