feisty meow concerns codebase  2.140
ini_roller.h
Go to the documentation of this file.
1 #ifndef INI_ROLLER_CLASS
2 #define INI_ROLLER_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : ini_roller *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2001-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include "configurator.h"
19 
20 #include <basis/definitions.h>
21 #include <basis/mutex.h>
22 #include <structures/roller.h>
23 
24 namespace configuration {
25 
27 
39 class ini_roller : public virtual basis::root_object
40 {
41 public:
42  ini_roller(configurator &config, const basis::astring &section,
43  const basis::astring &entry, int min, int max);
45 
52  virtual ~ini_roller();
53 
54  DEFINE_CLASS_NAME("ini_roller");
55 
56  int next_id();
58 
59  int current_id() const;
61 
62 private:
63  configurator &_ini;
65  basis::astring *_section;
66  basis::astring *_entry;
67  basis::mutex *_lock;
68 };
69 
70 } //namespace.
71 
72 #endif
73 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
Provides a base class for configuration repositories.
Definition: configurator.h:34
Implements an id generator that interacts with a configuration file.
Definition: ini_roller.h:40
ini_roller(configurator &config, const basis::astring &section, const basis::astring &entry, int min, int max)
creates a roller that updates "config" with the current id value.
Definition: ini_roller.cpp:33
DEFINE_CLASS_NAME("ini_roller")
int current_id() const
returns the current id; this is the one that was last issued.
Definition: ini_roller.cpp:58
int next_id()
returns the next number to be issued.
Definition: ini_roller.cpp:64
A roller that's based on integers. This is the most common type so far.
Definition: roller.h:79
Constants and objects used throughout HOOPLE.