00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef RCUCONF_SINGLEVALUE_H
00026 #define RCUCONF_SINGLEVALUE_H
00027 #ifndef RCUCONF_VALUE_H
00028 # include <rcuconf/Value.h>
00029 #endif
00030 #ifndef __LIST__
00031 # include <list>
00032 #endif
00033
00034
00035 namespace RcuDb
00036 {
00037 class Row;
00038 class Sql;
00039 }
00040
00041 namespace RcuConf
00042 {
00043 class Parameter;
00044 class Config;
00045
00051 class SingleValue : public Value
00052 {
00053 public:
00060 SingleValue(int config,
00061 int param,
00062 int address,
00063 int value)
00064 : Value(config, param, address),
00065 fValue(value)
00066 {}
00068 virtual ~SingleValue() { }
00069
00071 typedef std::list<SingleValue*> List;
00072
00074 virtual void Print() const;
00077 virtual bool Insert(RcuDb::Server& s);
00080 static bool Create(RcuDb::Server& s);
00083 static bool Drop(RcuDb::Server& s);
00089 static bool Select(List& l, RcuDb::Server& s, const RcuDb::Sql& cond);
00100 static bool Select(List& l, RcuDb::Server& s,
00101 const Config& c,
00102 const Parameter& p, int addr=-1);
00113 static bool Select(List& l, RcuDb::Server& s, int c, int p,
00114 int addr=-1);
00115
00117 int Values() const { return fValue; }
00119 void Set(int v) { fValue = v; }
00121 static const std::string fgName;
00122 protected:
00125 SingleValue(RcuDb::Row& row);
00127 int fValue;
00129 friend class Value;
00130 };
00131 }
00132 #endif
00133
00134
00135
00136