00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef RCUCONF_PARAMETER_H
00026 #define RCUCONF_PARAMETER_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 Result;
00037 class Row;
00038 class Sql;
00039 }
00040 namespace RcuConf
00041 {
00042
00048 class Parameter : public Table
00049 {
00050 public:
00052 enum Where {
00054 kRcu,
00056 kBc,
00058 kAltro,
00060 kInvalid
00061 };
00062
00068 Parameter(const std::string& name,
00069 Where dest,
00070 bool isBlob,
00071 unsigned int mask)
00072 : fName(name),
00073 fDestination(dest),
00074 fIsBlob(isBlob),
00075 fMask(mask)
00076 {}
00078 virtual ~Parameter() {}
00080 typedef std::list<Parameter*> List;
00081
00083 virtual void Print() const;
00086 virtual bool Insert(RcuDb::Server& s);
00089 static bool Create(RcuDb::Server& s);
00092 static bool Drop(RcuDb::Server& s);
00098 static bool Select(List& l, RcuDb::Server& s, const RcuDb::Sql& cond);
00105 static bool Select(List& l, RcuDb::Server& s, Where w,
00106 const std::string& name=std::string());
00107
00109 const std::string& Name() const { return fName; }
00111 Where Destination() const { return fDestination; }
00113 bool IsBlob() const { return fIsBlob; }
00115 unsigned int Mask() const { return fMask; }
00116
00118 static const std::string fgName;
00119 protected:
00122 Parameter(RcuDb::Row& row);
00124 std::string fName;
00126 Where fDestination;
00128 bool fIsBlob;
00130 unsigned int fMask;
00131 };
00136 std::ostream& operator<<(std::ostream& o, const Parameter::Where w);
00141 std::istream& operator>>(std::istream& i, Parameter::Where& w);
00142 }
00143 #endif
00144
00145
00146
00147