28 _exponents(0), _varCount(0) {
29 istringstream in(str);
31 vector<Exponent> exponents;
35 exponents.push_back(ex.get_ui());
38 if (!exponents.empty())
44 ObjectPool(): objectsStored(0), objects(0) {}
52 return objectsStored == 0;
55 bool canStoreMore()
const {
62 return objects[objectsStored];
69 objects[objectsStored] = object;
76 for (
size_t i = 0; i < objectsStored; ++i)
81 unsigned int objectsStored;
90 pools[size].ensureInit();
91 if (!pools[size].empty())
92 return pools[size].removeObject();
104 if (size <
PoolCount && pools[size].canStoreMore())
105 pools[size].addObject(p);
112 print(out, e, varCount);
113 fputs(out.str().c_str(), file);
117 ASSERT(e != 0 || varCount == 0);
120 for (
size_t var = 0; var < varCount; ++var) {
const unsigned int ObjectPoolSize
const unsigned int PoolCount
bool operator==(const Term &term) const
static Exponent * allocate(size_t size)
static void deallocate(Exponent *p, size_t size)
size_t getVarCount() const
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
void initialize(const Exponent *exponents, size_t varCount)
bool equals(const Word *a, const Word *b, size_t varCount)
Returns true if a equals b.