00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef RCUCONF_VALUE_H
00026 #define RCUCONF_VALUE_H
00027 #ifndef RCUCONF_TABLE_H
00028 # include <rcuconf/Table.h>
00029 #endif
00030 #ifndef __LIST__
00031 # include <list>
00032 #endif
00033 #include <iostream>
00034
00035 namespace RcuDb
00036 {
00037 class Result;
00038 class Row;
00039 class Sql;
00040 }
00041
00042 namespace RcuConf
00043 {
00044
00050 class Value : public Table
00051 {
00052 public:
00057 Value(int config,
00058 int param,
00059 int address)
00060 : fConfigId(config),
00061 fParamId(param),
00062 fAddressId(address),
00063 fVersion(-1)
00064 {
00065 if (fAddressId > 0) std::cout << "Address=" << address << std::endl;
00066 }
00068 virtual ~Value() { }
00069
00071 typedef std::list<Value*> List;
00072
00074 virtual void Print() const;
00075
00077 int ConfigId() const { return fConfigId; }
00079 int ParamId() const { return fParamId; }
00081 int AddressId() const { return fAddressId; }
00083 int Version() const { return fVersion; }
00084
00091 static bool Select(List& r, RcuDb::Server& s,
00092 const std::string& table, const RcuDb::Sql& cond);
00093
00106 static bool Select(List& r, RcuDb::Server& s,
00107 const std::string& table, int config, int param,
00108 int addr=-1);
00109 protected:
00116 static bool Select(RcuDb::Result*& r, RcuDb::Server& s,
00117 const std::string& table, const RcuDb::Sql& cond);
00130 static bool Select(RcuDb::Result*& r, RcuDb::Server& s,
00131 const std::string& table, int config, int param,
00132 int addr=-1);
00133
00137 RcuDb::Sql& ValueInsert(RcuDb::Sql& sql);
00138
00142 static RcuDb::Sql& ValueCreate(RcuDb::Sql& sql);
00143
00146 Value(RcuDb::Row& row);
00148 int fConfigId;
00150 int fParamId;
00152 int fAddressId;
00154 int fVersion;
00155 };
00156 }
00157
00158 #endif
00159
00160
00161
00162
00163
00164