1 /* 2 * growth_curve_factory.h 3 * 4 * This file is part of NEST. 5 * 6 * Copyright (C) 2004 The NEST Initiative 7 * 8 * NEST is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * NEST is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with NEST. If not, see <http://www.gnu.org/licenses/>. 20 * 21 */ 22 23 #ifndef GROWTH_CURVE_FACTORY_H 24 #define GROWTH_CURVE_FACTORY_H 25 26 // Includes from nestkernel: 27 #include "growth_curve.h" 28 29 namespace nest 30 { 31 32 class GrowthCurveGaussian; 33 class GrowthCurveLinear; 34 class GrowthCurveSigmoid; 35 36 /** 37 * Generic factory class for GrowthCurve objects. 38 * 39 * This factory allows for flexible registration 40 * of GrowthCurve subclasses and object creation. 41 * 42 */ 43 class GenericGrowthCurveFactory 44 { 45 public: ~GenericGrowthCurveFactory()46 virtual ~GenericGrowthCurveFactory() 47 { 48 } 49 virtual GrowthCurve* create() const = 0; 50 }; 51 52 /** 53 * Factory class for generating objects of type GrowthCurve 54 */ 55 56 template < typename GrowthCurveType > 57 class GrowthCurveFactory : public GenericGrowthCurveFactory 58 { 59 60 public: 61 GrowthCurve* create()62 create() const 63 { 64 return new GrowthCurveType(); 65 } 66 }; 67 68 } // namespace nest 69 70 #endif 71