00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef RCUCONF_CONFIG_H
00026 #define RCUCONF_CONFIG_H
00027 #ifndef RCUCONF_TABLE_H
00028 # include <rcuconf/Table.h>
00029 #endif
00030 #ifndef __LIST__
00031 # include <list>
00032 #endif
00033
00034 namespace RcuDb
00035 {
00036 class Row;
00037 class Sql;
00038 }
00039
00040 namespace RcuConf
00041 {
00048 class Config : public Table
00049 {
00050 public:
00058 Config(int tag,
00059 int x,
00060 int y,
00061 int z,
00062 int priority,
00063 const std::string& desc)
00064 : fTag(tag),
00065 fX(x),
00066 fY(y),
00067 fZ(z),
00068 fPriorityId(priority),
00069 fVersion(-1),
00070 fDescription(desc)
00071 {}
00073 virtual ~Config() { }
00074
00076 typedef std::list<Config*> List;
00077
00079 virtual void Print() const;
00082 virtual bool Insert(RcuDb::Server& s);
00085 static bool Create(RcuDb::Server& s);
00088 static bool Drop(RcuDb::Server& s);
00094 static bool Select(List& l, RcuDb::Server& s, const RcuDb::Sql& cond);
00104 static bool Select(List& l, RcuDb::Server& s, int tag, int x, int y, int z);
00105
00107 int Tag() const { return fTag; }
00109 int X() const { return fX; }
00111 int Y() const { return fY; }
00113 int Z() const { return fZ; }
00115 int PriorityId() const { return fPriorityId; }
00117 int Version() const { return fVersion; }
00119 const std::string& Description() const { return fDescription; }
00120
00122 static const std::string fgName;
00123 protected:
00126 Config(RcuDb::Row& row);
00128 int fTag;
00130 int fX;
00132 int fY;
00134 int fZ;
00136 int fPriorityId;
00138 int fVersion;
00140 std::string fDescription;
00141 };
00142 }
00143
00144 #endif
00145
00146
00147
00148
00149