Main MRPT website > C++ reference
MRPT logo
CLog.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 
29 /***************************************************************
30  * Name: Log.h
31  * Purpose: Defines the Log class
32  * Author: Vicente Arévalo (varevalo@ctima.uma.es)
33  * Created: 2009-09-23
34  * Copyright: mapir (http://babel.isa.uma.es/mapir)
35  * License:
36  **************************************************************/
37 
38 #ifndef CLog_H
39 #define CLog_H
40 
41 #include <mrpt/utils/utils_defs.h>
42 #include <mrpt/utils/CStringList.h>
44 
45 namespace mrpt
46 {
47  namespace utils
48  {
49  /** A decorator of CStringList special for keeping logs.
50  * \note Class written by Vicente Arevalo
51  * \ingroup mrpt_base_grp
52  */
54  {
55  public:
56  CLog();
57  virtual ~CLog();
58 
59  /** push a message
60  */
61  void pushMessages(std::string message);
62 
63  /** push a list of messages
64  */
65  void pushMessages(mrpt::utils::CStringList messages);
66 
67  /** pop the current unpublished message (clear the content of "message")
68  */
69  void popMessages(std::string& message);
70 
71  /** pop all unpublished messages (clear the content of "messages")
72  */
73  void popMessages(mrpt::utils::CStringList& messages);
74 
75  /** get messages from "begin" to "end" (clear the content of "messages")
76  */
77  void getMessages(size_t begin, size_t end, mrpt::utils::CStringList& messages);
78 
79  /** save the current log
80  */
81  void saveLog(std::string name);
82 
83  /** load a log (clear the previous content)
84  */
85  void loadLog(std::string name);
86 
87  /** clear the log content
88  */
89  void clearLog();
90 
91  /** change the last unpublished message. IMPORTANT: this function should
92  not be used directly.
93  */
94  void setLastMessageIndex(size_t index);
95 
96  /** get the current unpublished message index.
97  */
98  size_t getLastMessageIndex();
99 
100  protected:
101 
103 
104  size_t last;
105  };
106  }
107 }
108 
109 #endif // CLog_H
110 



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