34#ifndef _CHOMP_STRUCT_POOL_H_
35#define _CHOMP_STRUCT_POOL_H_
53template <
class element>
97template <
class element>
103template <
class element>
109template <
class element>
112 throw "Copy constructor for a pool not implemented.";
116template <
class element>
119 throw "Assignment operator for a pool not implemented.";
123template <
class element>
127 return unused [-- unusedCount];
132template <
class element>
138template <
class element>
141 if (n == elemCount - 1)
144 unused [unusedCount ++] = n;
A container for elements placed in a table (like a vector) that is actually built of many smaller tab...
This template contains the definition of a pool of elements that are stored in an extensible table.
multitable< int > unused
The multitable with indices of unused elements.
~pool()
The destructor of a pool.
void release(int number)
Marks the given element as unused and available for retrieval the next time the pool is asked for an ...
pool()
The constructor of a pool.
int elemCount
The number of elements in the multitable.
int unusedCount
The number of unused elements in the multitable.
int get()
Allocates a new element in the pool or finds a used one.
pool< element > & operator=(const pool< element > &)
The assignment operator is not allowed.
element & operator[](int number)
Retrieves the element in the pool with the given number.
multitable< element > elem
The multitable of elements.
This file contains the definition of the container "multitable" which is essentially an automatically...
This namespace contains the entire CHomP library interface.