solarpowerlog trunk
/home/tobi/workspace/solarpowerlog/src/interfaces/CCapability.h
Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  solarpowerlog
00003  Copyright (C) 2009  Tobias Frost
00004 
00005  This file is part of solarpowerlog.
00006 
00007  Solarpowerlog is free software; However, it is dual-licenced
00008  as described in the file "COPYING".
00009 
00010  For this file (CCapability.h), the license terms are:
00011 
00012  You can redistribute it and/or  modify it under the terms of the GNU Lesser
00013  General Public License (LGPL) as published by the Free Software Foundation;
00014  either version 3 of the License, or (at your option) any later version.
00015 
00016  This progrmm is distributed in the hope that it will be useful, but
00017  WITHOUT ANY WARRANTY; without even the implied warranty of
00018  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  Lesser General Public License for more details.
00020 
00021  You should have received a copy of the GNU Library General Public
00022  License along with this proramm; if not, see
00023  <http://www.gnu.org/licenses/>.
00024  ----------------------------------------------------------------------------
00025  */
00026 
00113 #ifndef CCAPABILITY_H_
00114 #define CCAPABILITY_H_
00115 
00116 #ifdef HAVE_CONFIG_H
00117 #include "config.h"
00118 #endif
00119 
00120 #include <string>
00121 #include "patterns/IObserverSubject.h"
00122 #include "patterns/IValue.h"
00123 
00124 #include <boost/utility.hpp>
00125 
00126 class IInverterBase;
00127 class IValue;
00128 
00129 using namespace std;
00130 
00148 class CCapability : public IObserverSubject ,
00149      boost::noncopyable
00150 {
00151 public:
00163      CCapability( const string& descr, IValue *val, IInverterBase *datasrc =
00164           NULL );
00165 
00167      CCapability( const string &descr, IValue::factory_types type,
00168           IInverterBase *datasrc = NULL );
00169 
00171      virtual ~CCapability();
00172 
00176      const string & getDescription() const
00177      {
00178           return description;
00179      }
00180 
00186      virtual IInverterBase *getSource() const
00187      {
00188           return source;
00189      }
00190 
00192      virtual IValue *getValue() const
00193      {
00194           return value;
00195      }
00196 
00197 protected:
00199      string description;
00201      IInverterBase *source;
00203      IValue *value;
00204 };
00205 
00206 #endif /* CCAPABILITY_H_ */