MeLOn
melon::AnnParserXml Class Reference

This class implements an specialization of the AnnParser for xml files. More...

#include <AnnParser.h>

Inheritance diagram for melon::AnnParserXml:
melon::AnnParser melon::ModelParser

Public Member Functions

std::shared_ptr< ModelDataparse_model (const std::string modelPath, const std::string modelName)
 Parsing function which is used to get the ANN data from a xml file. More...
 
- Public Member Functions inherited from melon::ModelParser
virtual ~ModelParser ()=default
 Virtual desctructor to enable inheritance. More...
 

Private Member Functions

tinyxml2::XMLError _parse_vector_int (tinyxml2::XMLElement *parentElement, const std::string vectorName, std::vector< int > &vector)
 Parses child elements of an xml element into an vector of int. More...
 
tinyxml2::XMLError _parse_vector_double (tinyxml2::XMLElement *parentElement, const std::string vectorName, std::vector< double > &vector)
 Parses child elements of an xml element into an vector of double. More...
 

Additional Inherited Members

- Protected Member Functions inherited from melon::AnnParser
ACTIVATION_FUNCTION _string_to_activation_function (const std::string &activationFunctionName)
 Turns a string containing the name of an activation function in the correct enum representation. More...
 
- Protected Member Functions inherited from melon::ModelParser
std::string _format_file_path (const std::string modelPath, const std::string modelName, const MODEL_FILE_TYPE fileType)
 Applies the correct format to the path given by the user. More...
 
- Static Protected Member Functions inherited from melon::ModelParser
static SCALER_TYPE _string_to_scaler_type (const std::string scalerTypeName)
 Turns a string containing the name of an scaler type in the correct enum representation. More...
 
static SCALER_PARAMETER _string_to_scaler_parameter (const std::string scalerParameterName)
 Turns a string containing the name of an scaler type in the correct enum representation. More...
 
- Protected Attributes inherited from melon::ModelParser
std::string _modelPath
 
std::string _modelName
 

Detailed Description

This class implements an specialization of the AnnParser for xml files.

This abstarct class is used to implement an ANN file parser for xml files based on the interface provided by AnnParser.

Member Function Documentation

◆ _parse_vector_double()

tinyxml2::XMLError AnnParserXml::_parse_vector_double ( tinyxml2::XMLElement parentElement,
const std::string  vectorName,
std::vector< double > &  vector 
)
private

Parses child elements of an xml element into an vector of double.

Parameters
[in]parentElementpointer to xml element whose child should get parsed
[in]vectorNamename of the child elements in the xml file
[out]vectorvector containing the parsed values
Returns
tinyxml2 error code indicating wether parsing was succesfull

◆ _parse_vector_int()

tinyxml2::XMLError AnnParserXml::_parse_vector_int ( tinyxml2::XMLElement parentElement,
const std::string  vectorName,
std::vector< int > &  vector 
)
private

Parses child elements of an xml element into an vector of int.

Parameters
[in]parentElementpointer to xml element whose child should get parsed
[in]vectorNamename of the child elements in the xml file
[out]vectorvector containing the parsed values
Returns
tinyxml2 error code indicating wether parsing was succesfull

◆ parse_model()

std::shared_ptr< ModelData > AnnParserXml::parse_model ( const std::string  modelPath,
const std::string  modelName 
)
virtual

Parsing function which is used to get the ANN data from a xml file.

Parameters
[in]modelPathPath to the location of the ANN file
[in]modelNamename of the network (name of the xml file)
Returns
returns modelData struct containing the information defining the ann

Implements melon::AnnParser.


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