export_argument.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 
27 
34 #ifndef ACADO_TOOLKIT_EXPORT_ARGUMENT_HPP
35 #define ACADO_TOOLKIT_EXPORT_ARGUMENT_HPP
36 
41 
43 
44 
46 
47 
61 class ExportArgument : public ExportData
62 {
63  //
64  // PUBLIC MEMBER FUNCTIONS:
65  //
66  public:
67 
70  ExportArgument( );
71 
84  ExportArgument( const std::string& _name,
85  uint _nRows = 1,
86  uint _nCols = 1,
87  ExportType _type = REAL,
88  ExportStruct _dataStruct = ACADO_LOCAL,
89  bool _callByValue = false,
90  const ExportIndex& _addressIdx = emptyConstExportIndex,
91  const std::string& _prefix = std::string()
92  );
93 
106  ExportArgument( const std::string& _name,
107  const DMatrixPtr& _data,
108  ExportType _type = REAL,
109  ExportStruct _dataStruct = ACADO_LOCAL,
110  bool _callByValue = false,
111  const ExportIndex& _addressIdx = emptyConstExportIndex,
112  const std::string& _prefix = std::string()
113  );
114 
115  ExportArgument( const DMatrix& _data
116  );
117 
119 
120  const ExportArgumentInternal* operator->() const;
121 
129  ExportArgument getAddress( const ExportIndex& _rowIdx,
130  const ExportIndex& _colIdx = emptyConstExportIndex
131  ) const;
132 
140  const std::string getAddressString( bool withDataStruct = true
141  ) const;
142 
143 
148  virtual uint getNumRows( ) const;
149 
154  virtual uint getNumCols( ) const;
155 
160  virtual uint getDim( ) const;
161 
162 
168  virtual bool isGiven( ) const;
169 
175  bool isCalledByValue( ) const;
176 
182 
183 
184 
195  virtual returnValue exportDataDeclaration( std::ostream& stream,
196  const std::string& _realString = "real_t",
197  const std::string& _intString = "int",
198  int _precision = 16
199  ) const;
200 };
201 
202 
204 
205 
207 
208 
209 #endif // ACADO_TOOLKIT_EXPORT_ARGUMENT_HPP
210 
211 // end of file.
virtual uint getDim() const
Allows to pass back messages to the calling function.
std::shared_ptr< GenericMatrix< double > > DMatrixPtr
Definition: matrix.hpp:463
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
virtual uint getNumCols() const
#define CLOSE_NAMESPACE_ACADO
Defines a scalar-valued index variable to be used for exporting code.
const ExportIndex emptyConstExportIndex(int(0))
Defines a matrix-valued variable that can be passed as argument to exported functions.
bool isCalledByValue() const
ExportStruct
virtual returnValue exportDataDeclaration(std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
ExportArgumentInternal * operator->()
Defines a matrix-valued variable that can be passed as argument to exported functions.
ExportType
virtual bool isGiven() const
static const ExportArgument emptyConstExportArgument
returnValue callByValue()
#define BEGIN_NAMESPACE_ACADO
Abstract base class to define variables to be used for exporting code.
Definition: export_data.hpp:55
ExportArgument getAddress(const ExportIndex &_rowIdx, const ExportIndex &_colIdx=emptyConstExportIndex) const
virtual uint getNumRows() const
const std::string getAddressString(bool withDataStruct=true) const


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