SMSTransformationChainConfig.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  *                         UNIVERSITAT POMPEU FABRA
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef _SMSTransformationChainConfig_
00023 #define _SMSTransformationChainConfig_
00024 
00025 #include "ProcessingComposite.hxx"
00026 #include "ProcessingData.hxx"
00027 #include "InPort.hxx"
00028 #include "OutPort.hxx"
00029 #include "InControlArray.hxx"
00030 #include "Array.hxx"
00031 
00032 #include "Frame.hxx" //TODO provisional
00033 #include "SegmentTransformation.hxx" //TODO provisional
00034 
00035 namespace CLAM{
00036 
00037 
00043         class SMSTransformationChaineeConfig:public ProcessingConfig
00044         {
00045         public:
00046                 DYNAMIC_TYPE_USING_INTERFACE (SMSTransformationChaineeConfig, 1,ProcessingConfig);
00048                 DYN_ATTRIBUTE (0, public, std::string, ConcreteClassName);
00049         public:
00053                 void DefaultInit();
00057                 void CopyInit(const SMSTransformationChaineeConfig& originalConfig);
00061                 void StoreOn(Storage & s) const; 
00065                 void LoadFrom(Storage& s);
00067                 ProcessingConfig& GetConcreteConfig() const {return *mpConcreteConfig;}
00072                 void SetConcreteConfig(const ProcessingConfig& cfg)
00073                 {
00074                         AddConcreteConfig();
00075                         *mpConcreteConfig=cfg;
00076                 }
00077 
00079                 virtual ~SMSTransformationChaineeConfig();
00080 
00085                 void AddConcreteConfig()
00086                 {
00087                         if(mpConcreteConfig) 
00088                                 delete mpConcreteConfig;
00089                         mpConcreteConfig=InstantiateConcreteConfig();
00090                 }
00091 
00092                 
00093         protected:
00095                 ProcessingConfig* InstantiateConcreteConfig(const std::string& type);
00096 
00100                 ProcessingConfig* InstantiateConcreteConfig()
00101                 {
00102                         return InstantiateConcreteConfig(GetConcreteClassName());
00103                 }
00104                 
00108                 ProcessingConfig* mpConcreteConfig;
00109                 
00110         };
00111 
00112 
00118         class SMSTransformationChainConfig:public ProcessingConfig
00119         {
00120         public:
00121                 typedef std::list<SMSTransformationChaineeConfig>::iterator iterator;
00122                 typedef std::list<SMSTransformationChaineeConfig>::const_iterator const_iterator;
00123 
00124                 DYNAMIC_TYPE_USING_INTERFACE (SMSTransformationChainConfig, 2, ProcessingConfig);
00126                 DYN_CONTAINER_ATTRIBUTE (0, public, std::list<SMSTransformationChaineeConfig>, Configurations, Config);
00128                 DYN_ATTRIBUTE (1, public, Array<bool>, OnArray);
00129 
00130                 
00132                 void DefaultInit();
00134                 iterator ConfigList_begin() {return GetConfigurations().begin();}
00136                 iterator ConfigList_end() {return GetConfigurations().end();}
00137 
00139                 const_iterator ConfigList_begin_const() const {return GetConfigurations().begin();}
00141                 const_iterator ConfigList_end_const() const {return GetConfigurations().end();}
00142 
00143                 bool AddSMSConfiguration(const SegmentTransformationConfig& cfg,std::string type)
00144                 {
00145                         AddConfiguration(cfg,type);
00146                         return true;
00147                 }
00148 
00150                 std::size_t ConfigList_size() const {return GetConfigurations().size();}
00151 
00152                 //TODO: maybe a method for deleting a configuration is also necessary
00153                 
00155                 bool IsEmpty(){return GetnConfigurations()<=0;}
00157                 TSize GetnConfigurations(){return ConfigList_size();}
00158 
00160                 virtual ~SMSTransformationChainConfig(){}
00161         protected:
00163                 virtual void AddConfiguration(const ProcessingConfig& newConcreteConfig,const std::string& className);
00164 
00165         };
00166         
00167 }//namespace
00168 
00169 #endif
00170 
Generated by  doxygen 1.6.3