Template Class CursorSpace
Defined in File CursorList.h
Nested Relationships
Nested Types
Class Documentation
-
template<class T>
class CursorSpace the vector of the cells of some CursorList, with its free list
Public Functions
-
explicit CursorSpace(long dim = 8)
a space of dim free cells, the places 1 , … , dim
- Pre:
dim >= 1
-
Cell &operator[](long c)
the cell at the cursor c
- Pre:
1 <= c <= capacity()
-
const Cell &operator[](long c) const
- Pre:
1 <= c <= capacity()
-
long take(void)
takes the first free cell, doubling the vector if there is none
- Post:
the result is a cell in use
-
void give(long c)
gives the cell c back to the free list
- Pre:
c is a cell in use
-
long capacity(void) const
the number of places, 0 excluded
-
long used(void) const
the number of cells in use
-
struct Cell
a cell: the item and the cursor of the next cell, 0 for nil
-
explicit CursorSpace(long dim = 8)