22 using namespace basis;
34 const astring &entry,
int min,
int max)
41 int current = _ini.
load(section, entry, min);
66 #ifdef DEBUG_ID_GRANTING
70 int to_return = _ids->
current();
81 #ifdef DEBUG_ID_GRANTING
82 LOG(
astring(astring::SPRINTF,
"standard id issue: %d.", to_return));
89 #ifdef DEBUG_ID_GRANTING
90 LOG(
astring(astring::SPRINTF,
"finding next range, new start in ini "
91 "is: %d.", new_range));
94 if ( (new_range < 0) || (new_range >= _ids->
maximum()) )
96 #ifdef DEBUG_ID_GRANTING
97 LOG(
astring(astring::SPRINTF,
"after check, new ini id is: %d.",
100 _ini.
store(*_section, *_entry, new_range);
103 #ifdef DEBUG_ID_GRANTING
104 LOG(
astring(astring::SPRINTF,
"after store, id is: %d.", to_return));
Provides a dynamically resizable ASCII character string.
auto_synchronizer simplifies concurrent code by automatically unlocking.
Provides a base class for configuration repositories.
bool store(const basis::astring §ion, const basis::astring &entry, const basis::astring &to_store)
a synonym for put.
basis::astring load(const basis::astring §ion, const basis::astring &entry, const basis::astring &default_value)
a synonym for get that implements the auto-store behavior.
int current_id() const
returns the current id; this is the one that was last issued.
int next_id()
returns the next number to be issued.
A roller that's based on integers. This is the most common type so far.
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.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
The guards collection helps in testing preconditions and reporting errors.
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
A dynamic container class that holds any kind of object via pointers.