SingleValue.h

Go to the documentation of this file.
00001 // -*- mode: C++ -*- 
00002 //
00003 // Copyright (C) 2006 Christian Holm Christensen <cholm@nbi.dk>
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public License
00007 // as published by the Free Software Foundation; either version 2.1
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free
00017 // Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018 // 02111-1307 USA
00019 //
00025 #ifndef RCUCONF_SINGLEVALUE_H
00026 #define RCUCONF_SINGLEVALUE_H
00027 #ifndef RCUCONF_VALUE_H
00028 # include <rcuconf/Value.h>
00029 #endif
00030 #ifndef __LIST__
00031 # include <list>
00032 #endif
00033 
00034 // Forward declarations 
00035 namespace RcuDb 
00036 {
00037   class Row;
00038   class Sql;
00039 }
00040 
00041 namespace RcuConf 
00042 {
00043   class Parameter;
00044   class Config;
00045   
00051   class SingleValue : public Value 
00052   {
00053   public:
00060     SingleValue(int  config, 
00061                 int  param, 
00062                 int  address, 
00063                 int  value) 
00064       : Value(config, param, address),
00065         fValue(value)
00066     {}
00068     virtual ~SingleValue() { }
00069 
00071     typedef std::list<SingleValue*> List;
00072 
00074     virtual void Print() const;
00077     virtual bool Insert(RcuDb::Server& s);
00080     static  bool Create(RcuDb::Server& s);
00083     static  bool Drop(RcuDb::Server& s);
00089     static  bool Select(List& l, RcuDb::Server& s, const RcuDb::Sql& cond);
00100     static  bool Select(List& l, RcuDb::Server& s, 
00101                         const Config&    c,
00102                         const Parameter& p, int addr=-1);
00113     static  bool Select(List& l, RcuDb::Server& s, int c, int p, 
00114                         int addr=-1);
00115 
00117     int Values() const { return fValue; }
00119     void Set(int v) { fValue = v; }
00121     static const std::string fgName;
00122   protected:
00125     SingleValue(RcuDb::Row& row);
00127     int fValue;
00129     friend class Value;
00130   };
00131 }
00132 #endif
00133 //
00134 // EOF
00135 //
00136 
Top of page Last update Fri Apr 27 01:54:16 2007
Copyright © 2004 Christian Holm Created by DoxyGen 1.3.5