PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
libpolybori
include
polybori
ring
CCuddCore.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//*****************************************************************************
14
//*****************************************************************************
15
16
#ifndef polybori_ring_CCuddCore_h
17
#define polybori_ring_CCuddCore_h
18
19
// include basic definitions
20
#include <
polybori/pbori_defs.h
>
21
22
#include "
CCuddInterface.h
"
23
#include "
CVariableNames.h
"
24
25
// get PolyBoRi routines and functionals
26
#include <
polybori/routines/pbori_func.h
>
27
#include <
polybori/common/traits.h
>
28
29
// intrisive (shared) pointer functionality
30
#include <boost/intrusive_ptr.hpp>
31
32
#include <vector>
33
#include <boost/shared_ptr.hpp>
34
35
BEGIN_NAMESPACE_PBORI
36
37
class
COrderingBase;
38
50
class
CCuddCore
:
51
public
CTypes::orderenums_type
,
public
CAuxTypes
,
52
public
CWeakPtrFacade
<CCuddCore> {
53
54
public
:
55
57
typedef
CCuddCore
self
;
58
60
typedef
CVariableNames
variable_names_type
;
61
63
typedef
variable_names_type::const_reference
const_varname_reference
;
64
66
CCuddInterface
m_mgr
;
67
69
typedef
COrderingBase
order_type
;
70
72
typedef
boost::shared_ptr<order_type>
order_ptr
;
73
75
typedef
order_type
&
order_reference
;
76
78
typedef
CTypes::ordercode_type
ordercode_type
;
79
81
refcount_type
ref
;
82
84
variable_names_type
m_names
;
85
86
88
order_ptr
pOrder
;
89
90
92
CCuddCore
(
size_type
numVarsZ,
const
order_ptr
& order):
93
m_mgr(0, numVarsZ), ref(0), m_names(numVarsZ),
94
pOrder(order) { }
95
98
CCuddCore
(
const
self
& rhs):
99
m_mgr(rhs.m_mgr), ref(0), m_names(rhs.m_names), pOrder(rhs.pOrder) { }
100
102
~CCuddCore
(){ }
103
105
void
addRef
(){ ++ref; }
106
108
refcount_type
release
() {
109
return
(--ref);
110
}
111
112
void
change_ordering
(
const
order_ptr
& newOrder) {
113
pOrder = newOrder;
114
}
115
116
};
117
119
120
121
inline
void
122
intrusive_ptr_add_ref
(
CCuddCore
* pCore){
123
pCore->
addRef
();
124
}
125
127
inline
void
128
intrusive_ptr_release
(
CCuddCore
* pCore) {
129
if
(!(pCore->
release
())) {
130
delete
pCore;
131
}
132
}
133
134
135
137
138
END_NAMESPACE_PBORI
139
140
#endif
141
142
Generated by
1.8.3.1