Main MRPT website > C++ reference
MRPT logo
CDebugOutputCapable.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef CDebugOutputCapable_H
29 #define CDebugOutputCapable_H
30 
31 #include <mrpt/utils/utils_defs.h>
32 #include <mrpt/utils/CStream.h>
33 
34 /*---------------------------------------------------------------
35  Class
36  ---------------------------------------------------------------*/
37 namespace mrpt
38 {
39  namespace utils
40  {
41  /** This base class provides a common printf-like method to send debug information to std::cout, with the purpose of allowing its redirection to other streams if desired.
42  * By default, messages sent to "printf_debug" will be shown in the console (cout) and also in
43  * the stream passed to debugOutputSetStream, but the console output can be
44  * switched off with debugOutputEnableConsole(false).
45  *
46  * In addition, this class will send all the messages from "printf_debug" to the Visual Studio "Output Window" in debug mode (obviously, this is a feature only enabled under Windows).
47  *
48  * See CDebugOutputCapable::printf_debug.
49  * \ingroup mrpt_base_grp
50  */
52  {
53  public:
54  /** Default initialization */
56  virtual ~CDebugOutputCapable() { }
57 
58  /** Sends a formated text to "debugOut" if not NULL, or to cout otherwise. */
59  static void printf_debug( const char *frmt, ... );
60 
61  }; // End of class def.
62 
63  } // End of namespace
64 } // end of namespace
65 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013