fw4spl
fwAtomsPatch/include/fwAtomsPatch/infos/Logger.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 __FWATOMSPATCH_INFOS_LOGGER_HPP__
8 #define __FWATOMSPATCH_INFOS_LOGGER_HPP__
9 
10 #include <string>
11 #include <vector>
12 #include <utility>
13 
14 #include <boost/shared_ptr.hpp>
15 
16 #include "fwAtomsPatch/config.hpp"
17 
18 namespace fwAtomsPatch
19 {
20 namespace infos
21 {
22 
27 class FWATOMSPATCH_CLASS_API Logger
28 {
29 public:
30 
31  typedef std::ostringstream StreamType;
32  typedef ::boost::shared_ptr< StreamType > StreamPtrType;
33 
35  FWATOMSPATCH_API ~Logger();
36 
38  FWATOMSPATCH_API void error(const std::string& message);
39 
41  FWATOMSPATCH_API void badCast(const std::string& message);
42 
44  FWATOMSPATCH_API void outOfRange(const std::string& message);
45 
47  FWATOMSPATCH_API void info(const std::string& message);
48 
50  FWATOMSPATCH_API void addAttribute(const std::string& message);
51 
53  FWATOMSPATCH_API void eraseAttribute(const std::string& message);
54 
56  FWATOMSPATCH_API void replaceAttribute(const std::string& message);
57 
58  static Logger &getLogger()
59  {
60  return s_logger;
61  }
62 
63  FWATOMSPATCH_API static StreamPtrType getStream();
64 
65 private:
66 
68  FWATOMSPATCH_API Logger();
69 
71  FWATOMSPATCH_API static Logger s_logger;
72 
74  FWATOMSPATCH_API static StreamPtrType s_stream;
75 };
76 
77 } //infos
78 } //fwAtomHelper
79 
80 #endif /* __FWATOMSPATCH_INFOS_LOGGER_HPP__ */
Logs events occurring during object patching.
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16