diff options
author | Johannes 'josch' Schauer <josch@debian.org> | 2019-01-27 13:56:24 +0100 |
---|---|---|
committer | Johannes 'josch' Schauer <josch@debian.org> | 2019-01-27 13:56:33 +0100 |
commit | 6ce553563bc795f389f639a3a8cdfe356de71441 (patch) | |
tree | da4c9ede3087ca534d93bc1ac5a14f044f036600 /fuzzylite/fl/factory | |
parent | bbefa170378553e5a6e0d72e4d52328b61f3e8ac (diff) |
new upstream version 6.0
Diffstat (limited to 'fuzzylite/fl/factory')
-rw-r--r-- | fuzzylite/fl/factory/ActivationFactory.h | 46 | ||||
-rw-r--r-- | fuzzylite/fl/factory/CloningFactory.h | 198 | ||||
-rw-r--r-- | fuzzylite/fl/factory/ConstructionFactory.h | 180 | ||||
-rw-r--r-- | fuzzylite/fl/factory/DefuzzifierFactory.h | 56 | ||||
-rw-r--r-- | fuzzylite/fl/factory/FactoryManager.h | 131 | ||||
-rw-r--r-- | fuzzylite/fl/factory/FunctionFactory.h | 44 | ||||
-rw-r--r-- | fuzzylite/fl/factory/HedgeFactory.h | 32 | ||||
-rw-r--r-- | fuzzylite/fl/factory/SNormFactory.h | 32 | ||||
-rw-r--r-- | fuzzylite/fl/factory/TNormFactory.h | 32 | ||||
-rw-r--r-- | fuzzylite/fl/factory/TermFactory.h | 32 |
10 files changed, 623 insertions, 160 deletions
diff --git a/fuzzylite/fl/factory/ActivationFactory.h b/fuzzylite/fl/factory/ActivationFactory.h new file mode 100644 index 0000000..6ebfc73 --- /dev/null +++ b/fuzzylite/fl/factory/ActivationFactory.h @@ -0,0 +1,46 @@ +/* + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> + + This file is part of fuzzylite. + + fuzzylite is free software: you can redistribute it and/or modify it under + the terms of the FuzzyLite License included with the software. + + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +#ifndef FL_ACTIVATIONFACTORY_H +#define FL_ACTIVATIONFACTORY_H + +#include "fl/fuzzylite.h" + +#include "fl/factory/ConstructionFactory.h" +#include "fl/activation/Activation.h" + +namespace fl { + + /** + The ActivationFactory class is a ConstructionFactory of Activation + methods for RuleBlock%s. + + @author Juan Rada-Vilela, Ph.D. + @see Activation + @see RuleBlock + @see ConstructionFactory + @see FactoryManager + @since 6.0 + */ + class FL_API ActivationFactory : public ConstructionFactory<Activation*> { + public: + ActivationFactory(); + virtual ~ActivationFactory() FL_IOVERRIDE; + FL_DEFAULT_COPY_AND_MOVE(ActivationFactory) + }; +} + +#endif /* FL_ACTIVATIONFACTORY_H */ diff --git a/fuzzylite/fl/factory/CloningFactory.h b/fuzzylite/fl/factory/CloningFactory.h index 3262721..a21e1d2 100644 --- a/fuzzylite/fl/factory/CloningFactory.h +++ b/fuzzylite/fl/factory/CloningFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_CLONINGFACTORY_H @@ -33,9 +25,20 @@ namespace fl { + /** + The CloningFactory class is the base class for a factory whose objects + are created from a registered object by calling the `clone()` method. + + @param <T> is the class of the object to be cloned + + @author Juan Rada-Vilela, Ph.D. + @see FactoryManager + @since 5.0 + */ + template <typename T> - class FL_API CloningFactory { - protected: + class CloningFactory { + private: std::string _name; std::map<std::string, T> _objects; @@ -46,17 +49,178 @@ namespace fl { virtual ~CloningFactory(); FL_DEFAULT_MOVE(CloningFactory) + /** + Returns the name of the factory + @return the name of the factory + */ virtual std::string name() const; + /** + Registers the object in the factory and assumes its ownership + @param key is the unique name by which objects are registered + @param object is the object to be cloned via a `clone` method + */ virtual void registerObject(const std::string& key, T object); + /** + Deregisters the given object from the factory and deletes it + @param key is the unique name by which objects are registered + */ virtual void deregisterObject(const std::string& key); + /** + Checks whether the factory has the given object registered + @param key is the unique name by which objects are registered + @return whether the factory has the given object registered + */ virtual bool hasObject(const std::string& key) const; + /** + Gets the object registered by the given key, not a clone of the object + @param key is the unique name by which objects are registered + @return the object registered by the given key + */ virtual T getObject(const std::string& key) const; + /** + Creates a cloned object by executing the clone method on the registered object + @param key is the unique name by which objects are registered + @return a cloned object by executing the clone method on the registered object + */ virtual T cloneObject(const std::string& key) const; + /** + Returns a vector of the available objects + @return a vector of the available objects + */ virtual std::vector<std::string> available() const; + /** + Gets the map of registered keys and objects + @return the map of registered keys and objects + */ + virtual std::map<std::string, T>& objects(); + /** + Gets an immutable map of registered keys and objects + @return an immutable map of registered keys and objects + */ + virtual const std::map<std::string, T>& objects() const; }; } +/** + Template implementation + */ + +#include "fl/Exception.h" + +namespace fl { + + template<typename T> + inline CloningFactory<T>::CloningFactory(const std::string& name) : _name(name) { + + } + + template<typename T> + inline CloningFactory<T>::CloningFactory(const CloningFactory& other) { + typename std::map<std::string, T>::const_iterator it = other._objects.begin(); + while (it != other._objects.end()) { + T clone = fl::null; + if (it->second) clone = it->second->clone(); + this->_objects[it->first] = clone; + ++it; + } + } + + template<typename T> + inline CloningFactory<T>& CloningFactory<T>::operator=(const CloningFactory& other) { + if (this != &other) { + typename std::map<std::string, T>::const_iterator it = this->_objects.begin(); + while (it != this->_objects.end()) { + if (it->second) delete it->second; + ++it; + } + this->_objects.clear(); + + it = other._objects.begin(); + while (it != other._objects.end()) { + T clone = fl::null; + if (it->second) clone = it->second->clone(); + this->_objects[it->first] = clone; + ++it; + } + } + return *this; + } + + template<typename T> + inline CloningFactory<T>::~CloningFactory() { + typename std::map<std::string, T>::const_iterator it = this->_objects.begin(); + while (it != this->_objects.end()) { + if (it->second) delete it->second; + ++it; + } + } + + template<typename T> + inline std::string CloningFactory<T>::name() const { + return this->_name; + } + + template<typename T> + inline void CloningFactory<T>::registerObject(const std::string& key, T object) { + this->_objects[key] = object; + } + + template<typename T> + inline void CloningFactory<T>::deregisterObject(const std::string& key) { + typename std::map<std::string, T>::iterator it = this->_objects.find(key); + if (it != this->_objects.end()) { + this->_objects.erase(it); + delete it->second; + } + } + + template<typename T> + inline bool CloningFactory<T>::hasObject(const std::string& key) const { + typename std::map<std::string, T>::const_iterator it = this->_objects.find(key); + return (it != this->_objects.end()); + } + + template<typename T> + inline T CloningFactory<T>::getObject(const std::string& key) const { + typename std::map<std::string, T>::const_iterator it = this->_objects.find(key); + if (it != this->_objects.end()) { + if (it->second) return it->second; + } + return fl::null; + } + + template<typename T> + inline T CloningFactory<T>::cloneObject(const std::string& key) const { + typename std::map<std::string, T>::const_iterator it = this->_objects.find(key); + if (it != this->_objects.end()) { + if (it->second) return it->second->clone(); + return fl::null; + } + throw Exception("[cloning error] " + _name + " object by name <" + key + "> not registered", FL_AT); + } + + template<typename T> + inline std::vector<std::string> CloningFactory<T>::available() const { + std::vector<std::string> result; + typename std::map<std::string, T>::const_iterator it = this->_objects.begin(); + while (it != this->_objects.end()) { + result.push_back(it->first); + } + return result; + } + + template<typename T> + inline std::map<std::string, T>& CloningFactory<T>::objects() { + return this->_objects; + } + + template<typename T> + inline const std::map<std::string, T>& CloningFactory<T>::objects() const { + return this->_objects; + } +} + #endif /* FL_CLONINGFACTORY_H */ diff --git a/fuzzylite/fl/factory/ConstructionFactory.h b/fuzzylite/fl/factory/ConstructionFactory.h index d01ca7d..2558d7f 100644 --- a/fuzzylite/fl/factory/ConstructionFactory.h +++ b/fuzzylite/fl/factory/ConstructionFactory.h @@ -1,29 +1,21 @@ /* - 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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ -#ifndef FL_FACTORY_H -#define FL_FACTORY_H +#ifndef FL_CONSTRUCTIONFACTORY_H +#define FL_CONSTRUCTIONFACTORY_H #include "fl/fuzzylite.h" @@ -33,12 +25,25 @@ namespace fl { + /** + The ConstructionFactory class is the base class for a factory whose + objects are created from a registered ConstructionFactory::Constructor. + + @author Juan Rada-Vilela, Ph.D. + @see FactoryManager + @since 5.0 + */ + template <typename T> - class FL_API ConstructionFactory { + class ConstructionFactory { public: + /** + The Constructor type definition refers to a zero-parameter method + which returns an instance of T + */ typedef T(*Constructor)(); - protected: + private: std::string _name; std::map<std::string, Constructor> _constructors; @@ -47,18 +52,151 @@ namespace fl { virtual ~ConstructionFactory(); FL_DEFAULT_COPY_AND_MOVE(ConstructionFactory) + /** + Returns the name of the factory + @return the name of the factory + */ virtual std::string name() const; + /** + Registers the constructor in the factory + @param key is the unique name by which constructors are registered + @param constructor is the pointer to the constructor of the object + */ virtual void registerConstructor(const std::string& key, Constructor constructor); + /** + Deregisters from the factory the constructor associated to the given key + @param key is the unique name by which constructors are registered + */ virtual void deregisterConstructor(const std::string& key); + /** + Checks whether the factory has a constructor registered by the given key + @param key is the unique name by which constructors are registered + @return whether the factory has the given constructor registered + */ virtual bool hasConstructor(const std::string& key) const; + /** + Gets the constructor registered by the given key + @param key is the unique name by which constructors are registered + @return the pointer to the given constructor + */ virtual Constructor getConstructor(const std::string& key) const; + /** + Creates an object by executing the constructor associated to the given key + @param key is the unique name by which constructors are registered + @return an object by executing the constructor associated to the given key + */ virtual T constructObject(const std::string& key) const; + /** + Returns a vector of keys for the constructors available + @return a vector of keys for the constructors available + */ virtual std::vector<std::string> available() const; - + /** + Gets the map of registered keys and constructors + @return the map of registered keys and constructors + */ + virtual std::map<std::string, Constructor>& constructors(); + /** + Gets an immutable map of registered keys and constructors + @return an immutable map of registered keys and constructors + */ + virtual const std::map<std::string, Constructor>& constructors() const; }; } -#endif /* FL_FACTORY_H */ +/** + * Template implementation + */ + + +#include "fl/Exception.h" +#include "fl/defuzzifier/Defuzzifier.h" +#include "fl/hedge/Hedge.h" +#include "fl/norm/SNorm.h" +#include "fl/norm/TNorm.h" +#include "fl/term/Term.h" + +namespace fl { + + template <typename T> + inline ConstructionFactory<T>::ConstructionFactory(const std::string& name) : _name(name) { + + } + + template <typename T> + inline ConstructionFactory<T>::~ConstructionFactory() { + } + + template<typename T> + inline std::string ConstructionFactory<T>::name() const { + return this->_name; + } + + template <typename T> + inline void ConstructionFactory<T>::registerConstructor(const std::string& key, Constructor constructor) { + this->_constructors[key] = constructor; + } + + template <typename T> + inline void ConstructionFactory<T>::deregisterConstructor(const std::string& key) { + typename std::map<std::string, Constructor>::iterator it = this->_constructors.find(key); + if (it != this->_constructors.end()) { + this->_constructors.erase(it); + } + } + + template <typename T> + inline bool ConstructionFactory<T>::hasConstructor(const std::string& key) const { + typename std::map<std::string, Constructor>::const_iterator it = this->_constructors.find(key); + return (it != this->_constructors.end()); + } + + template <typename T> + inline typename ConstructionFactory<T>::Constructor ConstructionFactory<T>::getConstructor(const std::string& key) const { + typename std::map<std::string, Constructor>::const_iterator it = this->_constructors.find(key); + if (it != this->_constructors.end()) { + return it->second; + } + return fl::null; + } + + template <typename T> + inline T ConstructionFactory<T>::constructObject(const std::string& key) const { + typename std::map<std::string, Constructor>::const_iterator it = this->_constructors.find(key); + if (it != this->_constructors.end()) { + if (it->second) { + return it->second(); + } + return fl::null; + } + std::ostringstream ss; + ss << "[factory error] constructor of " + _name + " <" << key << "> not registered"; + throw Exception(ss.str(), FL_AT); + } + + template <typename T> + inline std::vector<std::string> ConstructionFactory<T>::available() const { + std::vector<std::string> result; + typename std::map<std::string, Constructor>::const_iterator it = this->_constructors.begin(); + while (it != this->_constructors.end()) { + result.push_back(it->first); + ++it; + } + return result; + } + + template<typename T> + inline std::map<std::string, typename ConstructionFactory<T>::Constructor>& ConstructionFactory<T>::constructors() { + return this->_constructors; + } + + template<typename T> + inline const std::map<std::string, typename ConstructionFactory<T>::Constructor>& ConstructionFactory<T>::constructors() const { + return this->_constructors; + } +} + +#endif /* FL_CONSTRUCTIONFACTORY_H */ diff --git a/fuzzylite/fl/factory/DefuzzifierFactory.h b/fuzzylite/fl/factory/DefuzzifierFactory.h index 32d3ee7..8fa4c1b 100644 --- a/fuzzylite/fl/factory/DefuzzifierFactory.h +++ b/fuzzylite/fl/factory/DefuzzifierFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_DEFUZZIFIERFACTORY_H @@ -33,19 +25,51 @@ namespace fl { + /** + The DefuzzifierFactory class is a ConstructionFactory of Defuzzifier%s. + + @author Juan Rada-Vilela, Ph.D. + @see Defuzzifier + @see ConstructionFactory + @see FactoryManager + @since 4.0 + */ class FL_API DefuzzifierFactory : public ConstructionFactory<Defuzzifier*> { public: DefuzzifierFactory(); virtual ~DefuzzifierFactory() FL_IOVERRIDE; FL_DEFAULT_COPY_AND_MOVE(DefuzzifierFactory) + /** + Creates a Defuzzifier by executing the registered constructor + @param key is the unique name by which constructors are registered + @param resolution is the resolution of an IntegralDefuzzifier + @param type is the type of a WeightedDefuzzifier + @return a Defuzzifier by executing the registered constructor and + setting its resolution or type accordingly + */ virtual Defuzzifier* constructDefuzzifier(const std::string& key, - int resolution, WeightedDefuzzifier::Type) const; + int resolution, WeightedDefuzzifier::Type type) const; + /** + Creates a Defuzzifier by executing the registered constructor + @param key is the unique name by which constructors are registered + @param resolution is the resolution of an IntegralDefuzzifier + @return a Defuzzifier by executing the registered constructor and + setting its resolution + */ virtual Defuzzifier* constructDefuzzifier(const std::string& key, int resolution) const; + /** + Creates a Defuzzifier by executing the registered constructor + @param key is the unique name by which constructors are registered + @param type is the type of a WeightedDefuzzifier + @return a Defuzzifier by executing the registered constructor and + setting its type + */ virtual Defuzzifier* constructDefuzzifier(const std::string& key, WeightedDefuzzifier::Type type); }; } + #endif /* DEFUZZIFIERFACTORY_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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + 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<TNormFactory> _tnorm; FL_unique_ptr<SNormFactory> _snorm; + FL_unique_ptr<ActivationFactory> _activation; FL_unique_ptr<DefuzzifierFactory> _defuzzifier; FL_unique_ptr<TermFactory> _term; FL_unique_ptr<HedgeFactory> _hedge; FL_unique_ptr<FunctionFactory> _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 */ diff --git a/fuzzylite/fl/factory/FunctionFactory.h b/fuzzylite/fl/factory/FunctionFactory.h index c1ea9f1..84e0104 100644 --- a/fuzzylite/fl/factory/FunctionFactory.h +++ b/fuzzylite/fl/factory/FunctionFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_FUNCTIONFACTORY_H @@ -31,7 +23,18 @@ namespace fl { - class FunctionFactory : public CloningFactory<Function::Element*> { + /** + The FunctionFactory class is a CloningFactory of operators and functions + utilized by the Function term. + + @author Juan Rada-Vilela, Ph.D. + @see Function + @see Element + @see CloningFactory + @see FactoryManager + @since 5.0 + */ + class FL_API FunctionFactory : public CloningFactory<Function::Element*> { private: void registerOperators(); void registerFunctions(); @@ -40,11 +43,18 @@ namespace fl { virtual ~FunctionFactory() FL_IOVERRIDE; FL_DEFAULT_COPY_AND_MOVE(FunctionFactory) + /** + Returns a vector of the operators available + @return a vector of the operators available + */ virtual std::vector<std::string> availableOperators() const; + /** + Returns a vector of the functions available + @return a vector of the functions available + */ virtual std::vector<std::string> availableFunctions() const; }; - } #endif /* FL_FUNCTIONFACTORY_H */ diff --git a/fuzzylite/fl/factory/HedgeFactory.h b/fuzzylite/fl/factory/HedgeFactory.h index aca5d3a..e4733b2 100644 --- a/fuzzylite/fl/factory/HedgeFactory.h +++ b/fuzzylite/fl/factory/HedgeFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_HEDGEFACTORY_H @@ -31,6 +23,15 @@ namespace fl { + /** + The HedgeFactory class is a ConstructionFactory of Hedge%s. + + @author Juan Rada-Vilela, Ph.D. + @see Hedge + @see ConstructionFactory + @see FactoryManager + @since 4.0 + */ class FL_API HedgeFactory : public ConstructionFactory<Hedge*> { public: HedgeFactory(); @@ -38,5 +39,6 @@ namespace fl { FL_DEFAULT_COPY_AND_MOVE(HedgeFactory) }; } + #endif /* FL_HEDGEFACTORY_H */ diff --git a/fuzzylite/fl/factory/SNormFactory.h b/fuzzylite/fl/factory/SNormFactory.h index ca8bf1a..111664a 100644 --- a/fuzzylite/fl/factory/SNormFactory.h +++ b/fuzzylite/fl/factory/SNormFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_SNORMFACTORY_H @@ -31,6 +23,15 @@ namespace fl { + /** + The SNormFactory class is a ConstructionFactory of SNorm%s. + + @author Juan Rada-Vilela, Ph.D. + @see SNorm + @see ConstructionFactory + @see FactoryManager + @since 4.0 + */ class FL_API SNormFactory : public ConstructionFactory<SNorm*> { public: SNormFactory(); @@ -38,5 +39,6 @@ namespace fl { FL_DEFAULT_COPY_AND_MOVE(SNormFactory) }; } + #endif /* FL_SNORMFACTORY_H */ diff --git a/fuzzylite/fl/factory/TNormFactory.h b/fuzzylite/fl/factory/TNormFactory.h index 6af2249..5093fa7 100644 --- a/fuzzylite/fl/factory/TNormFactory.h +++ b/fuzzylite/fl/factory/TNormFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_TNORMFACTORY_H @@ -31,6 +23,15 @@ namespace fl { + /** + The TNormFactory class is a ConstructionFactory of TNorm%s. + + @author Juan Rada-Vilela, Ph.D. + @see TNorm + @see ConstructionFactory + @see FactoryManager + @since 4.0 + */ class FL_API TNormFactory : public ConstructionFactory<TNorm*> { public: TNormFactory(); @@ -38,5 +39,6 @@ namespace fl { FL_DEFAULT_COPY_AND_MOVE(TNormFactory) }; } + #endif /* FL_TNORMFACTORY_H */ diff --git a/fuzzylite/fl/factory/TermFactory.h b/fuzzylite/fl/factory/TermFactory.h index 6fd0656..f6a5d60 100644 --- a/fuzzylite/fl/factory/TermFactory.h +++ b/fuzzylite/fl/factory/TermFactory.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. <jcrada@fuzzylite.com> 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 <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_TERMFACTORY_H @@ -32,6 +24,15 @@ namespace fl { + /** + The TermFactory class is a ConstructionFactory of Term%s. + + @author Juan Rada-Vilela, Ph.D. + @see Term + @see ConstructionFactory + @see FactoryManager + @since 4.0 + */ class FL_API TermFactory : public ConstructionFactory<Term*> { public: TermFactory(); @@ -39,5 +40,6 @@ namespace fl { FL_DEFAULT_COPY_AND_MOVE(TermFactory) }; } + #endif /* FL_TERMFACTORY_H */ |