MutableSet(VarType t);
void addElementMSet(uint64_t element);
Set *clone(CSolver *solver, CloneMap *map);
+ bool isMutableSet() {return true;}
CMEMALLOC;
};
#endif
serializer->mywrite(&isRange, sizeof(bool));
serializer->mywrite(&low, sizeof(uint64_t));
serializer->mywrite(&high, sizeof(uint64_t));
+ bool isMutable = isMutableSet();
+ serializer->mywrite(&isMutable, sizeof(bool));
uint size = members->getSize();
serializer->mywrite(&size, sizeof(uint));
for(uint i=0; i<size; i++){
uint64_t getNewUniqueItem() {return low++;}
uint64_t getMemberAt(uint index);
uint64_t getElement(uint index);
+ virtual bool isMutableSet() {return false;}
virtual Set *clone(CSolver *solver, CloneMap *map);
virtual void serialize(Serializer* serializer);
CMEMALLOC;
#include "predicate.h"
#include "table.h"
#include "element.h"
+#include "mutableset.h"
Deserializer::Deserializer(const char* file):
solver(new CSolver())
myread(&low, sizeof(uint64_t));
uint64_t high;
myread(&high, sizeof(uint64_t));
+ bool isMutable;
+ myread(&isMutable, sizeof(bool));
+ Set *set;
+ if(isMutable){
+ set = new MutableSet(type);
+ }
uint size;
myread(&size, sizeof(uint));
Vector<uint64_t> members;
for(uint i=0; i<size; i++){
uint64_t mem;
myread(&mem, sizeof(uint64_t));
- members.push(mem);
+ if(isMutable) {
+ ((MutableSet*) set)->addElementMSet(mem);
+ }else {
+ members.push(mem);
+ }
+ }
+ if(!isMutable){
+ set = isRange? solver->createRangeSet(type, low, high):
+ solver->createSet(type, members.expose(), size);
}
- Set *set = isRange? solver->createRangeSet(type, low, high):
- solver->createSet(type, members.expose(), size);
map.put(s_ptr, set);
}