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 00027 00035 #ifndef ACADO_TOOLKIT_EXPORT_STATEMENT_HPP 00036 #define ACADO_TOOLKIT_EXPORT_STATEMENT_HPP 00037 00038 #include <acado/utils/acado_utils.hpp> 00039 00040 #ifdef _WIN32 00041 #include <memory> 00042 #else 00043 #include <tr1/memory> 00044 #endif 00045 00046 BEGIN_NAMESPACE_ACADO 00047 00048 00049 class ExportIndex; 00050 class MemoryAllocator; 00051 00052 00063 class ExportStatement 00064 { 00065 // 00066 // PUBLIC MEMBER FUNCTIONS: 00067 // 00068 public: 00069 00071 typedef std::tr1::shared_ptr< ExportStatement > StatementPtr; 00072 00074 typedef std::vector< StatementPtr > StatementPtrArray; 00075 00077 typedef std::tr1::shared_ptr< MemoryAllocator > MemoryAllocatorPtr; 00078 00080 ExportStatement( ); 00081 00086 ExportStatement( const ExportStatement& arg 00087 ); 00088 00090 virtual ~ExportStatement( ); 00091 00096 ExportStatement& operator=( const ExportStatement& arg 00097 ); 00098 00103 virtual ExportStatement* clone( ) const = 0; 00104 00105 00116 virtual returnValue exportDataDeclaration( std::ostream& stream, 00117 const std::string& _realString = "real_t", 00118 const std::string& _intString = "int", 00119 int _precision = 16 00120 ) const; 00121 00132 virtual returnValue exportCode( std::ostream& stream, 00133 const std::string& _realString = "real_t", 00134 const std::string& _intString = "int", 00135 int _precision = 16 00136 ) const = 0; 00137 00139 virtual ExportStatement& acquire( ExportIndex& ) 00140 { 00141 return *this; 00142 } 00143 00145 virtual ExportStatement& release( const ExportIndex& ) 00146 { 00147 return *this; 00148 } 00149 00151 virtual ExportStatement& allocate( MemoryAllocatorPtr ) 00152 { 00153 return *this; 00154 } 00155 }; 00156 00157 00158 CLOSE_NAMESPACE_ACADO 00159 00160 00161 #endif // ACADO_TOOLKIT_EXPORT_STATEMENT_HPP 00162 00163 // end of file.