Adding Transform object ... applying Brian's comments
[satune.git] / src / AST / order.cc
1 #include "order.h"
2 #include "structs.h"
3 #include "set.h"
4 #include "boolean.h"
5 #include "ordergraph.h"
6
7 Order::Order(OrderType _type, Set *_set) :
8         type(_type),
9         set(_set),
10         orderPairTable(NULL),
11         graph(NULL),
12         order(this)
13 {
14 }
15
16 void Order::initializeOrderHashTable() {
17         orderPairTable = new HashTableOrderPair();
18 }
19
20
21 void Order::addOrderConstraint(BooleanOrder *constraint) {
22         constraints.push(constraint);
23 }
24
25 void Order::setOrderEncodingType(OrderEncodingType type) {
26         order.type = type;
27 }
28
29 Order::~Order() {
30         if (orderPairTable != NULL) {
31                 orderPairTable->resetanddelete();
32                 delete orderPairTable;
33         }
34         
35         if (graph != NULL) {
36                 delete graph;
37         }
38 }