Main MRPT website
>
C++ reference for MRPT 1.4.0
mrpt
utils
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
>
24
#include <
mrpt/synch/CCriticalSection.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
*/
34
class
BASE_IMPEXP
CLog :
protected
mrpt::utils::CStringList
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
*/
46
void
pushMessages(
mrpt::utils::CStringList
messages);
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
*/
54
void
popMessages(
mrpt::utils::CStringList
& messages);
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
*/
79
size_t
getLastMessageIndex();
80
81
protected
:
82
83
mrpt::synch::CCriticalSection
semaphore;
84
85
size_t
last;
86
};
87
}
88
}
89
90
#endif // CLog_H
91
begin
EIGEN_STRONG_INLINE iterator begin()
Definition:
eigen_plugins.h:26
utils_defs.h
end
EIGEN_STRONG_INLINE iterator end()
Definition:
eigen_plugins.h:27
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition:
CParticleFilter.h:16
mrpt::synch::CCriticalSection
This class provides simple critical sections functionality.
Definition:
CCriticalSection.h:31
CStringList.h
CCriticalSection.h
mrpt::utils::CStringList
A class for storing a list of text lines.
Definition:
CStringList.h:32
BASE_IMPEXP
#define BASE_IMPEXP
Definition:
base/include/mrpt/base/link_pragmas.h:90
Page generated by
Doxygen 1.8.16
for MRPT 1.4.0 SVN: at Mon Oct 14 23:11:08 UTC 2019