#include <roller.h>
Collaboration diagram for roller< contents >:

Public Member Functions | |
| roller (contents start_of_range, contents end_of_range) | |
| constructs a roller between the start and end ranges. | |
| ~roller () | |
| contents | minimum () |
| the smallest value that the roller can have. | |
| contents | maximum () |
| the outer limit of the roller; it should never reach this. | |
| contents | next_id () |
| returns a unique (per instance of this type) id. | |
| contents | current () const |
| returns the current id to be used; be careful! | |
| void | set_current (contents new_current) |
| allows the current id to be manipulated. | |
The unique id is templated on the type of identifier, but the type used must support: 1) assigment to a value, 2) a greater than or equal operator (>=), and 3) the increment operator (++). Zero is often treated as the invalid / empty / inactive identifier, but roller does not prevent its use since some ranges might need to bridge between negative and positive numbers.
Definition at line 33 of file roller.h.
| roller< contents >::roller | ( | contents | start_of_range, | |
| contents | end_of_range | |||
| ) |
constructs a roller between the start and end ranges.
this constructs a roller that runs from the value "start_of_range" and will stay smaller than "end_of_range" (unless the initial parameters are screwed up; this class doesn't validate the start and end of range). when the roller hits the end of range, then its value is reset to the "start_of_range" again.
Definition at line 24 of file roller.cpp.
Definition at line 34 of file roller.cpp.
| contents roller< contents >::minimum | ( | ) | [inline] |
| contents roller< contents >::maximum | ( | ) | [inline] |
the outer limit of the roller; it should never reach this.
Definition at line 49 of file roller.h.
Referenced by ini_roller::next_id().
| contents roller< contents >::next_id | ( | ) |
returns a unique (per instance of this type) id.
Definition at line 39 of file roller.cpp.
Referenced by thread_cabinet::add_thread(), safe_roller::next_id(), ini_roller::next_id(), and cromp_client::next_id().
| contents roller< contents >::current | ( | ) | const |
returns the current id to be used; be careful!
this value will be the next one returned, so only look at the current id and don't use it unwisely. this function is useful if you want to assign an id provisionally but might not want to complete the issuance of it.
Definition at line 36 of file roller.cpp.
Referenced by safe_roller::current(), ini_roller::current_id(), ini_roller::ini_roller(), ini_roller::next_id(), and ini_roller::~ini_roller().
| void roller< contents >::set_current | ( | contents | new_current | ) |
allows the current id to be manipulated.
this must be done with care lest existing ids be re-used.
Definition at line 28 of file roller.cpp.
Referenced by ini_roller::ini_roller(), cromp_client::reset(), and safe_roller::set_current().
1.5.1