00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef RCUCONF_PRIORITY_H
00026 #define RCUCONF_PRIORITY_H
00027 #ifndef RCUCONF_TABLE_H
00028 # include <rcuconf/Table.h>
00029 #endif
00030 #ifndef RCUDB_BLOB_H
00031 # include <rcudb/Blob.h>
00032 #endif
00033 #ifndef __LIST__
00034 # include <list>
00035 #endif
00036
00037 namespace RcuDb
00038 {
00039 class Server;
00040 class Row;
00041 class Result;
00042 class Sql;
00043 }
00044
00045 namespace RcuConf
00046 {
00047
00048 class Config;
00049
00055 class Priority : public Table
00056 {
00057 public:
00061 Priority(const std::string& desc,
00062 const std::vector<int>& params)
00063 : fDescription(desc),
00064 fParams(params)
00065 {}
00067 virtual ~Priority() { }
00068
00070 typedef std::list<Priority*> List;
00071
00073 virtual void Print() const;
00076 virtual bool Insert(RcuDb::Server& s);
00079 static bool Create(RcuDb::Server& s);
00082 static bool Drop(RcuDb::Server& s);
00088 static bool Select(List& l, RcuDb::Server& s, const RcuDb::Sql& cond);
00094 static bool Select(List& l, RcuDb::Server& s, const Config& c);
00095
00097 const std::string& Description() const { return fDescription; }
00100 void Params(std::vector<int>& params) const { fParams.Decode(params); }
00101
00103 static const std::string fgName;
00104 protected:
00107 Priority(RcuDb::Row& row);
00109 std::string fDescription;
00111 RcuDb::Blob fParams;
00112
00113 };
00114 }
00115 #endif
00116
00117
00118
00119
00120