34 template <
class contents>
38 roller(contents start_of_range, contents end_of_range);
49 contents
minimum() {
return _start_of_range; }
51 contents
maximum() {
return _end_of_range; }
70 contents _start_of_range;
71 contents _end_of_range;
82 :
roller<int>(start_of_range, end_of_range) {}
89 template <
class contents>
91 : _current_id(start), _start_of_range(start), _end_of_range(end) {}
93 template <
class contents>
96 _current_id = new_current;
97 if (_current_id >= _end_of_range) _current_id = _start_of_range;
103 {
return _current_id; }
107 contents to_return = _current_id;
108 if (to_return == _end_of_range) {
113 _current_id = _start_of_range;
114 to_return = _current_id;
117 if (_current_id == _end_of_range) _current_id = _start_of_range;
A roller that's based on integers. This is the most common type so far.
int_roller(int start_of_range, int end_of_range)
Maintains a pseudo-unique identifier number and issues a new one on demand.
roller(contents start_of_range, contents end_of_range)
constructs a roller between the start and end ranges.
contents current() const
returns the current id to be used; be careful!
contents maximum()
the outer limit of the roller; it should never reach this.
void set_current(contents new_current)
allows the current id to be manipulated.
contents next_id()
returns a unique (per instance of this type) id.
contents minimum()
the smallest value that the roller can have.
Constants and objects used throughout HOOPLE.
A dynamic container class that holds any kind of object via pointers.