export_statement_block.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
35 #ifndef ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP
36 #define ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP
37 
38 
42 
43 #include <vector>
44 
46 
47 class ExportFunction;
50 class ExportVariable;
51 class ExportIndex;
53 
64 {
65  //
66  // PUBLIC MEMBER FUNCTIONS:
67  //
68  public:
69 
73 
79  );
80 
83  virtual ~ExportStatementBlock( );
84 
90  );
91 
96  virtual ExportStatement* clone( ) const;
97 
98 
105  returnValue addStatement( const ExportStatement& _statement
106  );
107 
114  returnValue addStatement( const std::string& _statementString
115  );
116 
117 
124  returnValue addFunction( const ExportFunction& _function
125  );
126 
127 
134  returnValue addFunctionCall( const std::string& _fName,
135  const ExportArgument& _argument1 = emptyConstExportArgument,
136  const ExportArgument& _argument2 = emptyConstExportArgument,
137  const ExportArgument& _argument3 = emptyConstExportArgument,
138  const ExportArgument& _argument4 = emptyConstExportArgument,
139  const ExportArgument& _argument5 = emptyConstExportArgument,
140  const ExportArgument& _argument6 = emptyConstExportArgument,
141  const ExportArgument& _argument7 = emptyConstExportArgument,
142  const ExportArgument& _argument8 = emptyConstExportArgument,
143  const ExportArgument& _argument9 = emptyConstExportArgument
144  );
145 
153  const ExportArgument& _argument1 = emptyConstExportArgument,
154  const ExportArgument& _argument2 = emptyConstExportArgument,
155  const ExportArgument& _argument3 = emptyConstExportArgument,
156  const ExportArgument& _argument4 = emptyConstExportArgument,
157  const ExportArgument& _argument5 = emptyConstExportArgument,
158  const ExportArgument& _argument6 = emptyConstExportArgument,
159  const ExportArgument& _argument7 = emptyConstExportArgument,
160  const ExportArgument& _argument8 = emptyConstExportArgument,
161  const ExportArgument& _argument9 = emptyConstExportArgument
162  );
163 
164 
172  ExportStruct _dataStruct = ACADO_ANY
173  );
174 
181  returnValue addDeclaration( const ExportIndex& _data,
182  ExportStruct _dataStruct = ACADO_ANY
183  );
184 
192  );
193 
201  );
202 
203 
210  returnValue addLinebreak( uint num = 1
211  );
212 
219  returnValue addComment( const std::string& _comment
220  );
221 
229  returnValue addComment( uint _nBlanks,
230  const std::string& _comment
231  );
232 
233 
238  uint getNumStatements( ) const;
239 
240 
251  virtual returnValue exportDataDeclaration( std::ostream& stream,
252  const std::string& _realString = "real_t",
253  const std::string& _intString = "int",
254  int _precision = 16
255  ) const;
256 
267  virtual returnValue exportCode( std::ostream& stream,
268  const std::string& _realString = "real_t",
269  const std::string& _intString = "int",
270  int _precision = 16
271  ) const;
272 
273 
278  returnValue clear( );
279 
281  friend ExportStatementBlock& operator<<(ExportStatementBlock& _block, const ExportStatement& _statement);
282 
284  friend ExportStatementBlock& operator<<(ExportStatementBlock& _block, const std::string& _statement);
285 
286 
287  //
288  // PROTECTED MEMBER FUNCTIONS:
289  //
290  protected:
291 
292 
293  //
294  // DATA MEMBERS:
295  //
296  protected:
297 
300 };
301 
302 
304 
305 
306 
307 #endif // ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP
308 
309 
310 /*
311  * end of file
312  */
Allows to export code containing variable declarations.
Allows to export code of an ACADO function.
Allows to pass back messages to the calling function.
Allows to export code containing function (forward) declarations.
returnValue addComment(const std::string &_comment)
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
std::vector< StatementPtr > StatementPtrArray
#define CLOSE_NAMESPACE_ACADO
virtual returnValue exportCode(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
Defines a scalar-valued index variable to be used for exporting code.
Defines a matrix-valued variable that can be passed as argument to exported functions.
virtual ExportStatement * clone() const
ExportStruct
Base class for all kind of statements to be exported by the code generation tool. ...
Allows to export code of an arbitrary function.
returnValue addStatement(const ExportStatement &_statement)
void rhs(const real_t *x, real_t *f)
returnValue addLinebreak(uint num=1)
static const ExportArgument emptyConstExportArgument
returnValue addDeclaration(const ExportVariable &_data, ExportStruct _dataStruct=ACADO_ANY)
friend ExportStatementBlock & operator<<(ExportStatementBlock &_block, const ExportStatement &_statement)
#define BEGIN_NAMESPACE_ACADO
returnValue addFunction(const ExportFunction &_function)
virtual returnValue exportDataDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
ExportStatementBlock & operator=(const ExportStatementBlock &rhs)
Allows to export code for a block of statements.
Defines a matrix-valued variable to be used for exporting code.
returnValue addFunctionCall(const std::string &_fName, const ExportArgument &_argument1=emptyConstExportArgument, const ExportArgument &_argument2=emptyConstExportArgument, const ExportArgument &_argument3=emptyConstExportArgument, const ExportArgument &_argument4=emptyConstExportArgument, const ExportArgument &_argument5=emptyConstExportArgument, const ExportArgument &_argument6=emptyConstExportArgument, const ExportArgument &_argument7=emptyConstExportArgument, const ExportArgument &_argument8=emptyConstExportArgument, const ExportArgument &_argument9=emptyConstExportArgument)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:34