logging.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 
00033 #ifndef ACADO_TOOLKIT_LOGGING_HPP
00034 #define ACADO_TOOLKIT_LOGGING_HPP
00035 
00036 #include <acado/utils/acado_utils.hpp>
00037 #include <acado/user_interaction/log_record.hpp>
00038 
00039 BEGIN_NAMESPACE_ACADO
00040 
00041 static LogRecord emptyLogRecord;
00042 
00055 class Logging
00056 {
00057         friend class AlgorithmicBase;
00058         
00059         //
00060         // PUBLIC MEMBER FUNCTIONS:
00061         //
00062         public:
00063 
00065                 Logging( );
00066 
00068                 virtual ~Logging( );
00069 
00080                 int operator<<( LogRecord& record
00081                                                 );
00082 
00090                 int addLogRecord(       LogRecord& record
00091                                                         );
00092 
00103                 returnValue getLogRecord(       LogRecord& _record
00104                                                                         ) const;
00105 
00115                 returnValue updateLogRecord(    LogRecord& _record
00116                                                                                 ) const;
00117 
00129                 inline returnValue getAll(      LogName _name,
00130                                                                         MatrixVariablesGrid& values
00131                                                                         ) const;
00132 
00144                 inline returnValue getFirst(    LogName _name,
00145                                                                                 DMatrix& firstValue
00146                                                                                 ) const;
00147 
00159                 inline returnValue getFirst(    LogName _name,
00160                                                                                 VariablesGrid& firstValue
00161                                                                                 ) const;
00162 
00174                 inline returnValue getLast(     LogName _name,
00175                                                                         DMatrix& lastValue
00176                                                                         ) const;
00177 
00189                 inline returnValue getLast(     LogName _name,
00190                                                                         VariablesGrid& lastValue
00191                                                                         ) const;
00192 
00204                 inline returnValue setAll(      LogName _name,
00205                                                                         const MatrixVariablesGrid& values
00206                                                                         );
00207 
00208 
00221                 inline returnValue setLast(     LogName _name,
00222                                                                         const DMatrix& value,
00223                                                                         double time = -INFTY
00224                                                                         );
00225 
00238                 inline returnValue setLast(     LogName _name,
00239                                                                         VariablesGrid& value,
00240                                                                         double time = -INFTY
00241                                                                         );
00242 
00247                 uint getNumLogRecords( ) const;
00248 
00249 
00254                 returnValue printLoggingInfo( ) const;
00255 
00256                 returnValue printNumDoubles( ) const;
00257 
00258     //
00259     // PROTECTED MEMBER FUNCTIONS:
00260     //
00261     protected:
00262 
00268                 virtual returnValue setupLogging( );
00269 
00270     //
00271     // DATA MEMBERS:
00272     //
00273         protected:
00275                 std::vector< LogRecord > logCollection;
00277                 int logIdx;
00278 };
00279 
00280 CLOSE_NAMESPACE_ACADO
00281 
00282 #include <acado/user_interaction/logging.ipp>
00283 
00284 #endif  // ACADO_TOOLKIT_LOGGING_HPP
00285 
00286 /*
00287  *      end of file
00288  */


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:59:05