experiments/include/component.h

00001 /********************************************************************************
00002  *  FARSA Experiments Library                                                   *
00003  *  Copyright (C) 2007-2012                                                     *
00004  *  Gianluca Massera <emmegian@yahoo.it>                                        *
00005  *  Stefano Nolfi <stefano.nolfi@istc.cnr.it>                                   *
00006  *  Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it>                         *
00007  *                                                                              *
00008  *  This program is free software; you can redistribute it and/or modify        *
00009  *  it under the terms of the GNU General Public License as published by        *
00010  *  the Free Software Foundation; either version 2 of the License, or           *
00011  *  (at your option) any later version.                                         *
00012  *                                                                              *
00013  *  This program is distributed in the hope that it will be useful,             *
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00016  *  GNU General Public License for more details.                                *
00017  *                                                                              *
00018  *  You should have received a copy of the GNU General Public License           *
00019  *  along with this program; if not, write to the Free Software                 *
00020  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00021  ********************************************************************************/
00022 
00023 #ifndef COMPONENT_H
00024 #define COMPONENT_H
00025 
00026 #include "experimentsconfig.h"
00027 #include "parametersettable.h"
00028 #include "configurationparameters.h"
00029 #include <QObject>
00030 #include <QString>
00031 
00032 namespace farsa {
00033 
00034 class ComponentUI;
00035 
00047 class FARSA_EXPERIMENTS_API Component : public QObject, public ParameterSettableWithConfigureFunction {
00048     Q_OBJECT
00049 public:
00051     Component() { /*nothing to do*/ };
00053     virtual ~Component() { /*nothing to do*/ };
00055     QString status() {
00056         return comStatus;
00057     };
00059     virtual ComponentUI* getUIManager() = 0;
00061     virtual void configure(ConfigurationParameters& params, QString prefix) = 0;
00063     virtual void save(ConfigurationParameters& params, QString prefix) = 0;
00065     void setStatus( QString newStatus ) {
00066         comStatus = newStatus;
00067         emit statusChanged( newStatus );
00068     };
00069 signals:
00071     void statusChanged( QString newStatus );
00072 private:
00074     QString comStatus;
00075 };
00076 
00077 } // end namespace farsa
00078 
00079 #endif