virtual ~Element() {}
Vector<ASTNode *> parents;
ElementEncoding encoding;
+ inline ElementEncoding *getElementEncoding() { return &encoding; }
virtual Element *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;};
+ virtual void serialize(Serializer *serializer) = 0;
+ virtual void print() = 0;
virtual void updateParents() {}
- virtual Set * getRange() = 0;
+ virtual Set *getRange() = 0;
CMEMALLOC;
};
class ElementSet : public Element {
public:
ElementSet(ASTNodeType type, Set *s);
+ virtual ~ElementSet() {}
ElementSet(Set *s);
virtual Element *clone(CSolver *solver, CloneMap *map);
+ virtual void serialize(Serializer *serializer);
+ virtual void print();
CMEMALLOC;
Set *getRange() {return set;}
- private:
+protected:
Set *set;
};
class ElementConst : public ElementSet {
public:
ElementConst(uint64_t value, Set *_set);
+ virtual ~ElementConst() {}
uint64_t value;
+ virtual void serialize(Serializer *serializer);
+ virtual void print();
Element *clone(CSolver *solver, CloneMap *map);
CMEMALLOC;
};
class ElementFunction : public Element {
public:
+ virtual ~ElementFunction() {}
ElementFunction(Function *function, Element **array, uint numArrays, BooleanEdge overflowstatus);
Array<Element *> inputs;
BooleanEdge overflowstatus;
FunctionEncoding functionencoding;
Element *clone(CSolver *solver, CloneMap *map);
- Set * getRange();
+ virtual void serialize(Serializer *serializer);
+ virtual void print();
+ Set *getRange();
void updateParents();
- Function * getFunction() {return function;}
+ Function *getFunction() {return function;}
+ inline FunctionEncoding *getElementFunctionEncoding() {return &functionencoding;}
CMEMALLOC;
- private:
+private:
Function *function;
};
-static inline ElementEncoding *getElementEncoding(Element *e) {
- return &e->encoding;
-}
-static inline FunctionEncoding *getElementFunctionEncoding(ElementFunction *func) {
- return &func->functionencoding;
-}
#endif