Switch array struct to class
[satune.git] / src / AST / boolean.cc
index b349c9a5468a67f35c20335a5a585516ce5fe779..08af722b1c2e406f1559450b6aca3f7b5cedaaec 100644 (file)
@@ -15,17 +15,21 @@ BooleanOrder::BooleanOrder(Order *_order, uint64_t _first, uint64_t _second) : B
        pushVectorBooleanOrder(&order->constraints, this);
 }
 
-BooleanPredicate::BooleanPredicate(Predicate *_predicate, Element **_inputs, uint _numInputs, Boolean *_undefinedStatus) : Boolean(PREDICATEOP), predicate(_predicate), undefStatus(_undefinedStatus) {
-       initArrayInitElement(&inputs, _inputs, _numInputs);
-
+BooleanPredicate::BooleanPredicate(Predicate *_predicate, Element **_inputs, uint _numInputs, Boolean *_undefinedStatus) :
+       Boolean(PREDICATEOP),
+       predicate(_predicate),
+       inputs(_inputs, _numInputs),
+       undefStatus(_undefinedStatus) {
        for (uint i = 0; i < _numInputs; i++) {
                pushVectorASTNode(GETELEMENTPARENTS(_inputs[i]), this);
        }
        initPredicateEncoding(&encoding, this);
 }
 
-BooleanLogic::BooleanLogic(CSolver *solver, LogicOp _op, Boolean **array, uint asize) : Boolean(LOGICOP), op(_op) {
-       initArrayInitBoolean(&inputs, array, asize);
+BooleanLogic::BooleanLogic(CSolver *solver, LogicOp _op, Boolean **array, uint asize) :
+       Boolean(LOGICOP),
+       op(_op),
+       inputs(array, asize) {
        pushVectorBoolean(solver->allBooleans, (Boolean *) this);
 }
 
@@ -34,10 +38,5 @@ Boolean::~Boolean() {
 }
 
 BooleanPredicate::~BooleanPredicate() {
-       deleteInlineArrayElement(&inputs );
        deleteFunctionEncoding(&encoding);
 }
-
-BooleanLogic::~BooleanLogic() {
-       deleteInlineArrayBoolean(&inputs);
-}