35 #include <acado/code_generation/templates/templates.hpp> 46 const std::string& _fileName,
47 const std::string& _commonHeaderName,
48 const std::string& _realString,
49 const std::string& _intString,
51 const std::string& _commentString
54 setup( _templateName,_fileName,_commonHeaderName,_realString,_intString,_precision,_commentString );
59 const std::string& _fileName,
60 const std::string& _commonHeaderName,
61 const std::string& _realString,
62 const std::string& _intString,
64 const std::string& _commentString
67 ExportFile::setup( _fileName, _commonHeaderName, _realString, _intString, _precision, _commentString );
85 pos =
folders.find(
";", oldPos);
88 inputFile.open(tmp.c_str());
90 if (inputFile.is_open() ==
true)
93 if (pos == string::npos)
95 LOG(
LVL_ERROR ) <<
"Unable to open the file: " << tmp << endl;
103 while ( getline(inputFile, str) )
108 while ((pos = str.find(it->first, pos)) != string::npos)
110 str.replace(pos, it->first.length(), it->second);
111 pos += it->second.length();
#define LOG(level)
Just define a handy macro for getting the logger.
virtual returnValue setup(const std::string &_templateName, const std::string &_fileName, const std::string &_commonHeaderName="", const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16, const std::string &_commentString=std::string())
std::map< std::string, std::string > dictionary
Allows to pass back messages to the calling function.
Returned value is a error.
#define CLOSE_NAMESPACE_ACADO
Allows to export files containing automatically generated algorithms for fast model predictive contro...
virtual returnValue setup(const std::string &_fileName, const std::string &_commonHeaderName="", const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16, const std::string &_commentString=std::string())
returnValue addStatement(const ExportStatement &_statement)
#define BEGIN_NAMESPACE_ACADO
returnValue fillTemplate()
#define ACADOERROR(retval)