00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef RCUCONF_BLOBVALUE_H
00026 #define RCUCONF_BLOBVALUE_H
00027 #ifndef RCUCONF_VALUE_H
00028 # include <rcuconf/Value.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 Row;
00040 class Sql;
00041 }
00042
00043 namespace RcuConf
00044 {
00045 class Parameter;
00046 class Config;
00047
00053 class BlobValue : public Value
00054 {
00055 public:
00062 template <typename T>
00063 BlobValue(int config,
00064 int param,
00065 int address,
00066 const std::vector<T>& value)
00067 : Value(config, param, address),
00068 fValue(value)
00069 {}
00071 virtual ~BlobValue() { }
00072
00074 typedef std::list<BlobValue*> List;
00075
00077 virtual void Print() const;
00080 virtual bool Insert(RcuDb::Server& s);
00083 static bool Create(RcuDb::Server& s);
00086 static bool Drop(RcuDb::Server& s);
00092 static bool Select(List& l, RcuDb::Server& s, const RcuDb::Sql& cond);
00103 static bool Select(List& l, RcuDb::Server& s,
00104 const Config& c,
00105 const Parameter& p,
00106 int addr=-1);
00117 static bool Select(List& l, RcuDb::Server& s, int c, int p,
00118 int addr=-1);
00119
00121 template <typename T>
00122 void Values(std::vector<T>& v) const
00123 {
00124 fValue.Decode(v);
00125 }
00127 template <typename T>
00128 void Set(const std::vector<T>& v)
00129 {
00130 fValue.Encode(v);
00131 }
00133 static const std::string fgName;
00134 protected:
00137 BlobValue(RcuDb::Row& row);
00139 RcuDb::Blob fValue;
00141 friend class Value;
00142 };
00143 }
00144 #endif
00145
00146
00147
00148