Merge branch 'hamed'
[satune.git] / src / AST / set.h
1 /*
2  * File:   set.h
3  * Author: hamed
4  *
5  * Created on June 13, 2017, 3:01 PM
6  */
7
8 #ifndef SET_H
9 #define SET_H
10
11 #include "classlist.h"
12 #include "structs.h"
13 #include "mymemory.h"
14
15 struct Set {
16         VarType type;
17         bool isRange;
18         uint64_t low;//also used to count unique items
19         uint64_t high;
20         VectorInt *members;
21 };
22
23 Set *allocSet(VarType t, uint64_t *elements, uint num);
24 Set *allocSetRange(VarType t, uint64_t lowrange, uint64_t highrange);
25 bool existsInSet(Set *This, uint64_t element);
26 uint getSetSize(Set *This);
27 uint64_t getSetElement(Set *This, uint index);
28 void deleteSet(Set *This);
29 #endif/* SET_H */
30