From 6ce553563bc795f389f639a3a8cdfe356de71441 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sun, 27 Jan 2019 13:56:24 +0100 Subject: new upstream version 6.0 --- fuzzylite/fl/factory/FactoryManager.h | 131 ++++++++++++++++++++++++++-------- 1 file changed, 102 insertions(+), 29 deletions(-) (limited to 'fuzzylite/fl/factory/FactoryManager.h') diff --git a/fuzzylite/fl/factory/FactoryManager.h b/fuzzylite/fl/factory/FactoryManager.h index d853d93..79f7996 100644 --- a/fuzzylite/fl/factory/FactoryManager.h +++ b/fuzzylite/fl/factory/FactoryManager.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see . - - fuzzyliteâ„¢ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see . + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_FACTORYMANAGER_H @@ -27,55 +19,136 @@ #include "fl/fuzzylite.h" +#include "fl/factory/TNormFactory.h" +#include "fl/factory/SNormFactory.h" +#include "fl/factory/ActivationFactory.h" +#include "fl/factory/DefuzzifierFactory.h" +#include "fl/factory/TermFactory.h" +#include "fl/factory/HedgeFactory.h" +#include "fl/factory/FunctionFactory.h" + namespace fl { - class TNormFactory; - class SNormFactory; - class DefuzzifierFactory; - class TermFactory; - class HedgeFactory; - class FunctionFactory; + /** + The FactoryManager class is a central class grouping different factories + of objects, together with a singleton instance to access each of the + factories throughout the library. + + + @author Juan Rada-Vilela, Ph.D. + @see TermFactory + @see TNormFactory + @see SNormFactory + @see HedgeFactory + @see ActivationFactory + @see DefuzzifierFactory + @see FunctionFactory + @since 4.0 + */ class FL_API FactoryManager { - protected: - static FactoryManager _instance; - + private: FL_unique_ptr _tnorm; FL_unique_ptr _snorm; + FL_unique_ptr _activation; FL_unique_ptr _defuzzifier; FL_unique_ptr _term; FL_unique_ptr _hedge; FL_unique_ptr _function; + public: FactoryManager(); - FactoryManager(TNormFactory* tnorm, SNormFactory* snorm, - DefuzzifierFactory* defuzzifier, TermFactory* term, - HedgeFactory* hedge, FunctionFactory* function); - FactoryManager(const FactoryManager& other); + explicit FactoryManager(TNormFactory* tnorm, SNormFactory* snorm, + ActivationFactory* activation, DefuzzifierFactory* defuzzifier, + TermFactory* term, HedgeFactory* hedge, FunctionFactory* function); + explicit FactoryManager(const FactoryManager& other); FactoryManager& operator=(const FactoryManager& other); FL_DEFAULT_MOVE(FactoryManager) virtual ~FactoryManager(); - public: + /** + Gets the static instance of the manager + @return the static instance of the manager + */ static FactoryManager* instance(); + /** + Sets the factory of TNorm%s + @param tnorm is the factory of TNorm%s + */ virtual void setTnorm(TNormFactory* tnorm); + /** + Gets the factory of TNorm%s + @return the factory of TNorm%s + */ virtual TNormFactory* tnorm() const; + /** + Sets the factory of SNorm%s + @param snorm is the factory of SNorm%s + */ virtual void setSnorm(SNormFactory* snorm); + /** + Gets the factory of SNorm%s + @return the factory of SNorm%s + */ virtual SNormFactory* snorm() const; + /** + Sets the factory of Activation methods + @param activation is the factory of Activation methods + */ + virtual void setActivation(ActivationFactory* activation); + /** + Gets the factory of Activation methods + @return the factory of Activation methods + */ + virtual ActivationFactory* activation() const; + + /** + Sets the factory of Defuzzifier%s + @param defuzzifier is the factory of Defuzzifier%s + */ virtual void setDefuzzifier(DefuzzifierFactory* defuzzifier); + /** + Gets the factory of Defuzzifier%s + @return the factory of Defuzzifier%s + */ virtual DefuzzifierFactory* defuzzifier() const; + /** + Sets the factory of Term%s + @param term is the factory of Term%s + */ virtual void setTerm(TermFactory* term); + /** + Gets the factory of Term%s + @return the factory of Term%s + */ virtual TermFactory* term() const; + /** + Sets the factory of Hedge%s + @param hedge is the factory of Hedge%s + */ virtual void setHedge(HedgeFactory* hedge); + /** + Gets the factory of Hedge%s + @return the factory of Hedge%s + */ virtual HedgeFactory* hedge() const; + /** + Sets the factory of Function Element%s + @param function is the factory of Function Element%s + */ virtual void setFunction(FunctionFactory* function); + /** + Gets the factory of Function Element%s + @return the factory of Function Element%s + */ virtual FunctionFactory* function() const; }; } + #endif /* FL_FACTORYMANAGER_H */ -- cgit v1.2.3