Main MRPT website > C++ reference for MRPT 1.4.0
CLog.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 /***************************************************************
11  * Name: Log.h
12  * Purpose: Defines the Log class
13  * Author: Vicente Arevalo (varevalo@ctima.uma.es)
14  * Created: 2009-09-23
15  * Copyright: mapir (http://babel.isa.uma.es/mapir)
16  * License:
17  **************************************************************/
18 
19 #ifndef CLog_H
20 #define CLog_H
21 
22 #include <mrpt/utils/utils_defs.h>
23 #include <mrpt/utils/CStringList.h>
25 
26 namespace mrpt
27 {
28  namespace utils
29  {
30  /** A decorator of CStringList special for keeping logs.
31  * \note Class written by Vicente Arevalo
32  * \ingroup mrpt_base_grp
33  */
35  {
36  public:
37  CLog();
38  virtual ~CLog();
39 
40  /** push a message
41  */
42  void pushMessages(std::string message);
43 
44  /** push a list of messages
45  */
47 
48  /** pop the current unpublished message (clear the content of "message")
49  */
50  void popMessages(std::string& message);
51 
52  /** pop all unpublished messages (clear the content of "messages")
53  */
55 
56  /** get messages from "begin" to "end" (clear the content of "messages")
57  */
58  void getMessages(size_t begin, size_t end, mrpt::utils::CStringList& messages);
59 
60  /** save the current log
61  */
62  void saveLog(std::string name);
63 
64  /** load a log (clear the previous content)
65  */
66  void loadLog(std::string name);
67 
68  /** clear the log content
69  */
70  void clearLog();
71 
72  /** change the last unpublished message. IMPORTANT: this function should
73  not be used directly.
74  */
75  void setLastMessageIndex(size_t index);
76 
77  /** get the current unpublished message index.
78  */
80 
81  protected:
82 
84 
85  size_t last;
86  };
87  }
88 }
89 
90 #endif // CLog_H
91 
This class provides simple critical sections functionality.
A decorator of CStringList special for keeping logs.
Definition: CLog.h:35
void pushMessages(mrpt::utils::CStringList messages)
push a list of messages
void saveLog(std::string name)
save the current log
size_t last
Definition: CLog.h:85
void getMessages(size_t begin, size_t end, mrpt::utils::CStringList &messages)
get messages from "begin" to "end" (clear the content of "messages")
void setLastMessageIndex(size_t index)
change the last unpublished message.
void popMessages(mrpt::utils::CStringList &messages)
pop all unpublished messages (clear the content of "messages")
void clearLog()
clear the log content
void loadLog(std::string name)
load a log (clear the previous content)
mrpt::synch::CCriticalSection semaphore
Definition: CLog.h:83
void pushMessages(std::string message)
push a message
size_t getLastMessageIndex()
get the current unpublished message index.
void popMessages(std::string &message)
pop the current unpublished message (clear the content of "message")
A class for storing a list of text lines.
Definition: CStringList.h:33
EIGEN_STRONG_INLINE iterator begin()
Definition: eigen_plugins.h:26
EIGEN_STRONG_INLINE iterator end()
Definition: eigen_plugins.h:27
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.1 for MRPT 1.4.0 SVN: at Fri Sep 3 01:11:30 UTC 2021