export_statement_block.hpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00035 #ifndef ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP
00036 #define ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP
00037 
00038 
00039 #include <acado/utils/acado_utils.hpp>
00040 #include <acado/code_generation/export_statement.hpp>
00041 #include <acado/code_generation/export_argument.hpp>
00042 
00043 #include <vector>
00044 
00045 BEGIN_NAMESPACE_ACADO
00046 
00047 class ExportFunction;
00048 class ExportAcadoFunction;
00049 class ExportFunctionDeclaration;
00050 class ExportVariable;
00051 class ExportIndex;
00052 class ExportDataDeclaration;
00053 
00063 class ExportStatementBlock : public ExportStatement
00064 {
00065         //
00066         // PUBLIC MEMBER FUNCTIONS:
00067         //
00068         public:
00069 
00072                 ExportStatementBlock( );
00073 
00078                 ExportStatementBlock(   const ExportStatementBlock& arg
00079                                                                 );
00080 
00083                 virtual ~ExportStatementBlock( );
00084 
00089                 ExportStatementBlock& operator=(        const ExportStatementBlock& rhs
00090                                                                                         );
00091 
00096                 virtual ExportStatement* clone( ) const;
00097 
00098 
00105                 returnValue addStatement(       const ExportStatement& _statement
00106                                                                         );
00107 
00114                 returnValue addStatement(       const std::string& _statementString
00115                                                                         );
00116 
00117 
00124                 returnValue addFunction(        const ExportFunction& _function
00125                                                                         );
00126 
00127 
00134                 returnValue addFunctionCall(    const std::string& _fName,
00135                                                                                 const ExportArgument& _argument1 = emptyConstExportArgument,
00136                                                                                 const ExportArgument& _argument2 = emptyConstExportArgument,
00137                                                                                 const ExportArgument& _argument3 = emptyConstExportArgument,
00138                                                                                 const ExportArgument& _argument4 = emptyConstExportArgument,
00139                                                                                 const ExportArgument& _argument5 = emptyConstExportArgument,
00140                                                                                 const ExportArgument& _argument6 = emptyConstExportArgument,
00141                                                                                 const ExportArgument& _argument7 = emptyConstExportArgument,
00142                                                                                 const ExportArgument& _argument8 = emptyConstExportArgument,
00143                                                                                 const ExportArgument& _argument9 = emptyConstExportArgument
00144                                                                                 );
00145 
00152                 returnValue addFunctionCall(    const ExportFunction& _f,
00153                                                                                 const ExportArgument& _argument1 = emptyConstExportArgument,
00154                                                                                 const ExportArgument& _argument2 = emptyConstExportArgument,
00155                                                                                 const ExportArgument& _argument3 = emptyConstExportArgument,
00156                                                                                 const ExportArgument& _argument4 = emptyConstExportArgument,
00157                                                                                 const ExportArgument& _argument5 = emptyConstExportArgument,
00158                                                                                 const ExportArgument& _argument6 = emptyConstExportArgument,
00159                                                                                 const ExportArgument& _argument7 = emptyConstExportArgument,
00160                                                                                 const ExportArgument& _argument8 = emptyConstExportArgument,
00161                                                                                 const ExportArgument& _argument9 = emptyConstExportArgument
00162                                                                                 );
00163 
00164 
00171                 returnValue addDeclaration(     const ExportVariable& _data,
00172                                                                         ExportStruct _dataStruct = ACADO_ANY
00173                                                                         );
00174 
00181                 returnValue addDeclaration(     const ExportIndex& _data,
00182                                                                         ExportStruct _dataStruct = ACADO_ANY
00183                                                                         );
00184 
00191                 returnValue addDeclaration(     const ExportFunction& _f
00192                                                                         );
00193 
00200                 returnValue addDeclaration(     const ExportAcadoFunction& _f
00201                                                                         );
00202 
00203 
00210                 returnValue addLinebreak(       uint num = 1
00211                                                                         );
00212 
00219                 returnValue addComment( const std::string& _comment
00220                                                                 );
00221 
00229                 returnValue addComment( uint _nBlanks,
00230                                                                 const std::string& _comment
00231                                                                 );
00232 
00233 
00238                 uint getNumStatements( ) const;
00239 
00240 
00251                 virtual returnValue exportDataDeclaration(      std::ostream& stream,
00252                                                                                                         const std::string& _realString = "real_t",
00253                                                                                                         const std::string& _intString = "int",
00254                                                                                                         int _precision = 16
00255                                                                                                         ) const;
00256 
00267                 virtual returnValue exportCode( std::ostream& stream,
00268                                                                                 const std::string& _realString = "real_t",
00269                                                                                 const std::string& _intString = "int",
00270                                                                                 int _precision = 16
00271                                                                                 ) const;
00272 
00273 
00278                 returnValue clear( );
00279 
00281                 friend ExportStatementBlock& operator<<(ExportStatementBlock& _block, const ExportStatement& _statement);
00282 
00284                 friend ExportStatementBlock& operator<<(ExportStatementBlock& _block, const std::string& _statement);
00285 
00286 
00287         //
00288         // PROTECTED MEMBER FUNCTIONS:
00289         //
00290         protected:
00291 
00292 
00293         //
00294         // DATA MEMBERS:
00295         //
00296         protected:
00297 
00299                 StatementPtrArray statements;
00300 };
00301 
00302 
00303 CLOSE_NAMESPACE_ACADO
00304 
00305 
00306 
00307 #endif  // ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP
00308 
00309 
00310 /*
00311  *      end of file
00312  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:37:01