00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef conf_int_H
00026 #define conf_int_H
00027
00028
00029 #include "platform.h"
00030
00031
00032 #include <climits>
00033 #include <string>
00034
00035
00036 #include "conf/conf.h"
00037
00038 namespace IXE {
00039
00048 template <> class conf<int> : public VarDefault<int>
00049 {
00050 public:
00051 conf(char const *name,
00052 int default_value, int min = 0, int max = INT_MAX);
00053
00054 conf<int>& operator =(int new_value);
00055
00056 conf<int>& operator =(char const* s) {
00057 parseValue(s);
00058 return *this;
00059 }
00060
00061 conf<int>& operator ++() {
00062 ++value;
00063 return *this;
00064 }
00065 conf<int> operator ++(int) {
00066 conf<int> tmp = *this;
00067 ++value;
00068 return tmp;
00069 }
00070 conf<int>& operator --() {
00071 --value;
00072 return *this;
00073 }
00074 conf<int> operator --(int) {
00075 conf<int> tmp = *this;
00076 --value;
00077 return tmp;
00078 }
00079
00080 protected:
00081 virtual void parseValue(char const*& line);
00082 private:
00083 int const min_, max_;
00084 };
00085
00086 }
00087
00088 #endif