|
solarpowerlog trunk
|
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 (IDataFilter.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 program 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 00027 00056 #ifndef IDATAFILTER_H_ 00057 #define IDATAFILTER_H_ 00058 00059 #ifdef HAVE_CONFIG_H 00060 #include "config.h" 00061 #endif 00062 00077 #include "patterns/IObserverObserver.h" 00078 #include "patterns/IObserverSubject.h" 00079 #include "Inverters/interfaces/InverterBase.h" 00080 #include "patterns/ICommand.h" 00081 00082 class IDataFilter : public IObserverObserver , 00083 public IInverterBase // The inverter, though the capabilites, also provides the 00084 // interface for being a subject (observer pattern) 00085 { 00086 protected: 00087 IDataFilter( const string &name, const string & configurationpath ) : 00088 IInverterBase(name, configurationpath, "datafilter") 00089 { } 00090 00091 public: 00092 virtual ~IDataFilter(); 00093 00097 virtual void ExecuteCommand( const ICommand *) 00098 { } 00099 00100 // Just a reminder: You need to override that. 00101 virtual bool CheckConfig() = 0; 00102 00103 // Just another reminder. Update is called by the subject, 00104 // when new data arrives. So you defintly want to override this. 00105 virtual void Update( const IObserverSubject *subject ) = 0; 00106 00113 virtual ICapaIterator* GetCapaNewIterator(); 00114 00123 virtual CCapability *GetConcreteCapability( const string &identifier ); 00124 00125 protected: 00132 IInverterBase *base; 00133 00134 }; 00135 00136 #endif /* IDATAFILTER_H_ */