BALL  1.4.1
modelFactory.h
Go to the documentation of this file.
00001 /* modelFactory.h
00002  * 
00003  * Copyright (C) 2009 Marcel Schumann
00004  * 
00005  * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
00006  * Construction and Validation.
00007  * QuEasy is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3 of the License, or (at
00010  * your option) any later version.
00011  * 
00012  * QuEasy is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 // -*- Mode: C++; tab-width: 2; -*-
00022 // vi: set ts=2:
00023 //
00024 // $Id: factory.h,v 1.10 2003/08/26 08:04:07 oliver Exp $
00025 //
00026 
00027 #ifndef MODEL_FACTORY_H
00028 #define MODEL_FACTORY_H
00029 
00030 #ifndef BALL_CONCEPT_FACTORY_H
00031 #include <BALL/CONCEPT/factory.h>
00032 #endif
00033 
00034 #ifndef MODEL
00035 #include <BALL/QSAR/Model.h>
00036 #endif
00037 
00038 #ifndef QSARH
00039 #include <BALL/QSAR/QSARData.h>
00040 #endif
00041 
00042 namespace BALL
00043 {
00044   namespace QSAR
00045   {
00046     //typedef Model* (*CreateMethod) (const QSARData& q);
00047     
00050     template <typename T>
00051     class ModelFactory
00052     {
00053       public:
00054       
00055       static T* create(const QSARData& q)
00056       {
00057         return new T(q);
00058       }
00059       
00060       static T* createKernel1(const QSARData& q, int k, double p1, double p2)
00061       {
00062         return new T(q,k,p1,p2);
00063       }
00064       
00065       static T* createKernel2(const QSARData& q, String s1, String s2)
00066       {
00067         return new T(q,s1,s2);
00068       }
00069     };
00070   }
00071 }
00072 
00073 #endif // QSAR_FACTORY_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines