fw4spl
ScopedMessage.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWCORE_LOG_SCOPEDMESSAGE_HPP__
8 #define __FWCORE_LOG_SCOPEDMESSAGE_HPP__
9 
10 #include <string>
11 
12 #include "fwCore/BaseObject.hpp"
13 #include "fwCore/HiResTimer.hpp"
14 #include "fwCore/config.hpp"
15 
16 namespace fwCore
17 {
18 namespace log
19 {
20 
21 class SpyLogger;
22 
31 class FWCORE_CLASS_API ScopedMessage : public ::fwCore::BaseObject
32 {
33 
34 public:
35 
36  FWCORE_API ScopedMessage( const char * _file, int _line, std::string enterMessage, std::string leaveMessage = "");
37 
38  void use()
39  {
40  } // avoid compiler warnings like "variable X never used"
41 
42  FWCORE_API virtual ~ScopedMessage();
43 
44 protected:
45 
46  const char * m_file;
47  int m_line;
48  std::string m_baseMsg;
49  std::string m_leave;
50 
51  ::fwCore::HiResTimer m_timer;
52 };
53 
54 } // namespace log
55 } // namespace fwCore
56 
57 #endif // __FWCORE_LOG_SCOPEDMESSAGE_HPP__
This class provide a timer (stopwatch). HiResTimer is able to measure the elapsed time with a few mic...
Definition: HiResTimer.hpp:28
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
This namespace fwCore provides common foundations for FW4SPL.
Definition: BaseObject.hpp:16