fuzzylite  6.0
A Fuzzy Logic Control Library in C++
fl::CppExporter Class Reference

The CppExporter class is an Exporter that translates an Engine and its components to the C++ programming language using the fuzzylite library. More...

#include <CppExporter.h>

Inheritance diagram for fl::CppExporter:
Collaboration diagram for fl::CppExporter:

Public Member Functions

 CppExporter (bool usingNamespace=false, bool usingVariableNames=true)
 
virtual ~CppExporter () FL_IOVERRIDE
 
virtual std::string name () const FL_IOVERRIDE
 Returns the name of the exporter. More...
 
virtual std::string toString (const Engine *engine) const FL_IOVERRIDE
 Returns a string representation of the engine. More...
 
virtual void setUsingNamespace (bool usingNamespace)
 Sets whether the fl namespace of the library is prepended to types (e.g., fl::Engine) More...
 
virtual bool isUsingNamespace () const
 Gets whether the fl namespace of the library is prepended to types (e.g., fl::Engine) More...
 
virtual std::string fl (const std::string &clazz) const
 Returns the given text prepended with the fl namespace if CppExporter::isUsingNamespace is true, or the text otherwise. More...
 
virtual void setUsingVariableNames (bool usingVariableNames)
 Sets whether variables are exported using their names (e.g., power->setValue(fl::nan)) instead of numbered identifiers (e.g., inputVariable1->setValue(fl::nan)) More...
 
virtual bool isUsingVariableNames () const
 Gets whether variables are exported using their names (e.g., power->setValue(fl::nan)) instead of numbered identifiers (e.g., inputVariable1->setValue(fl::nan)) More...
 
virtual std::string toString (const InputVariable *inputVariable, const Engine *engine) const
 Returns a string representation of InputVariable in the C++ programming language. More...
 
virtual std::string toString (const OutputVariable *outputVariable, const Engine *engine) const
 Returns a string representation of the OutputVariable in the C++ programming language. More...
 
virtual std::string toString (const RuleBlock *ruleBlock, const Engine *engine) const
 Returns a string representation of the RuleBlock in the C++ programming language. More...
 
virtual std::string toString (const Activation *activation) const
 Returns a string representation of the Activation method in the C++ programming language. More...
 
virtual std::string toString (scalar value) const
 Returns a string representation of the scalar value in the C++ programming language. More...
 
virtual std::string toString (const Hedge *hedge) const
 Returns a string representation of the Hedge in the C++ programming language. More...
 
virtual std::string toString (const Term *term) const
 Returns a string representation of the Term in the C++ programming language. More...
 
virtual std::string toString (const Norm *norm) const
 Returns a string representation of the Norm in the C++ programming language. More...
 
virtual std::string toString (const Defuzzifier *defuzzifier) const
 Returns a string representation of the Defuzzifier in the C++ programming language. More...
 
virtual CppExporterclone () const FL_IOVERRIDE
 Creates a clone of the exporter. More...
 
- Public Member Functions inherited from fl::Exporter
 Exporter ()
 
virtual ~Exporter ()
 
virtual void toFile (const std::string &path, const Engine *engine) const
 Stores the string representation of the engine into the specified file. More...
 

Detailed Description

The CppExporter class is an Exporter that translates an Engine and its components to the C++ programming language using the fuzzylite library.

Author
Juan Rada-Vilela, Ph.D.
See also
JavaExporter
Exporter
Since
4.0

Definition at line 43 of file CppExporter.h.

Constructor & Destructor Documentation

◆ CppExporter()

fl::CppExporter::CppExporter ( bool  usingNamespace = false,
bool  usingVariableNames = true 
)
explicit

◆ ~CppExporter()

virtual fl::CppExporter::~CppExporter ( )
virtual

Member Function Documentation

◆ clone()

virtual CppExporter* fl::CppExporter::clone ( ) const
virtual

Creates a clone of the exporter.

Returns
a clone of the exporter

Implements fl::Exporter.

◆ fl()

virtual std::string fl::CppExporter::fl ( const std::string &  clazz) const
virtual

Returns the given text prepended with the fl namespace if CppExporter::isUsingNamespace is true, or the text otherwise.

Parameters
clazzis the text to be prepended the fl::.
Returns
the given text prepended with the fl namespace if CppExporter::isUsingNamespace is true, or the text otherwise

◆ isUsingNamespace()

virtual bool fl::CppExporter::isUsingNamespace ( ) const
virtual

Gets whether the fl namespace of the library is prepended to types (e.g., fl::Engine)

Returns
whether the fl namespace of the library is prepended to types

◆ isUsingVariableNames()

virtual bool fl::CppExporter::isUsingVariableNames ( ) const
virtual

Gets whether variables are exported using their names (e.g., power->setValue(fl::nan)) instead of numbered identifiers (e.g., inputVariable1->setValue(fl::nan))

Returns
whether variables are exported using their names

◆ name()

virtual std::string fl::CppExporter::name ( ) const
virtual

Returns the name of the exporter.

Returns
the name of the exporter

Implements fl::Exporter.

◆ setUsingNamespace()

virtual void fl::CppExporter::setUsingNamespace ( bool  usingNamespace)
virtual

Sets whether the fl namespace of the library is prepended to types (e.g., fl::Engine)

Parameters
usingNamespacewhether the fl namespace of the library is prepended to types (e.g., fl::Engine)

◆ setUsingVariableNames()

virtual void fl::CppExporter::setUsingVariableNames ( bool  usingVariableNames)
virtual

Sets whether variables are exported using their names (e.g., power->setValue(fl::nan)) instead of numbered identifiers (e.g., inputVariable1->setValue(fl::nan))

Parameters
usingVariableNamesindicates whether variables are exported using their names

◆ toString() [1/10]

virtual std::string fl::CppExporter::toString ( const Engine engine) const
virtual

Returns a string representation of the engine.

Parameters
engineis the engine to export
Returns
a string representation of the engine

Implements fl::Exporter.

◆ toString() [2/10]

virtual std::string fl::CppExporter::toString ( const InputVariable inputVariable,
const Engine engine 
) const
virtual

Returns a string representation of InputVariable in the C++ programming language.

Parameters
inputVariableis the input variable
engineis the engine in which the input variable is registered
Returns
a string representation of the input variable in the C++ programming language

◆ toString() [3/10]

virtual std::string fl::CppExporter::toString ( const OutputVariable outputVariable,
const Engine engine 
) const
virtual

Returns a string representation of the OutputVariable in the C++ programming language.

Parameters
outputVariableis the output variable
engineis the engine in which the output variable is registered
Returns
a string representation of the output variable in the C++ programming language

◆ toString() [4/10]

virtual std::string fl::CppExporter::toString ( const RuleBlock ruleBlock,
const Engine engine 
) const
virtual

Returns a string representation of the RuleBlock in the C++ programming language.

Parameters
ruleBlockis the rule block
engineis the engine in which the rule block is registered
Returns
a string representation of the rule block in the C++ programming language

◆ toString() [5/10]

virtual std::string fl::CppExporter::toString ( const Activation activation) const
virtual

Returns a string representation of the Activation method in the C++ programming language.

Parameters
activationis the activation method
Returns
a string representation of the activation method in the C++ programming language

◆ toString() [6/10]

virtual std::string fl::CppExporter::toString ( scalar  value) const
virtual

Returns a string representation of the scalar value in the C++ programming language.

Parameters
valueis the scalar value
Returns
a string representation of the scalar value in the C++ programming language

◆ toString() [7/10]

virtual std::string fl::CppExporter::toString ( const Hedge hedge) const
virtual

Returns a string representation of the Hedge in the C++ programming language.

Parameters
hedgeis the hedge
Returns
a string representation of the hedge in the C++ programming language

◆ toString() [8/10]

virtual std::string fl::CppExporter::toString ( const Term term) const
virtual

Returns a string representation of the Term in the C++ programming language.

Parameters
termis the term
Returns
a string representation of the term in the C++ programming language

◆ toString() [9/10]

virtual std::string fl::CppExporter::toString ( const Norm norm) const
virtual

Returns a string representation of the Norm in the C++ programming language.

Parameters
normis the norm
Returns
a string representation of the norm in the C++ programming language

◆ toString() [10/10]

virtual std::string fl::CppExporter::toString ( const Defuzzifier defuzzifier) const
virtual

Returns a string representation of the Defuzzifier in the C++ programming language.

Parameters
defuzzifieris the defuzzifier
Returns
a string representation of the defuzzifier in the C++ programming language

The documentation for this class was generated from the following file: