OperationReport.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralin/vp/OperationReport.h
22 
23  \brief Class used as a report logger for Operations.
24 */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_OPERATIONREPORT_H
27 #define __TERRALIB_VP_INTERNAL_OPERATIONREPORT_H
28 
29 #include "Config.h"
30 
31 // STL
32 #include <cstdio>
33 #include <ctime>
34 #include <map>
35 #include <string>
36 #include <sstream>
37 
38 namespace te
39 {
40  namespace vp
41  {
42  /*!
43  \class OperationReport
44 
45  \brief Class used as a report logger for Operations.
46  */
48  {
49  public:
50 
51  /*! \brief Default constructor. */
53 
54  /*! \brief Virtual destructor. */
56 
57  public:
58 
59  void addTitle(const std::string& message);
60 
61  void addSubTitle(const std::string& message);
62 
63  void addMessage(const std::string& message, const std::string& severity = "", bool appendTime = false);
64 
65  void addStartMessage(const std::string& message, int id);
66 
67  void addEndMessage(const std::string& message, int id);
68 
69  void addKeyValueMessage(const std::string& key, const std::string& value);
70 
71  void addEmptyLine();
72 
73  void toFile(const std::string& reportPath);
74 
75  std::string toString();
76 
77 
78  protected:
79 
80  std::stringstream m_reportStr;
81 
82  std::map<int, std::clock_t> m_clockTime;
83  };
84  }
85 }
86 
87 #endif // __TERRALIB_VP_INTERNAL_OPERATIONREPORT_H
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::vp::OperationReport::addSubTitle
void addSubTitle(const std::string &message)
te::vp::OperationReport::toFile
void toFile(const std::string &reportPath)
te::vp::OperationReport
Class used as a report logger for Operations.
Definition: OperationReport.h:48
te::vp::OperationReport::addStartMessage
void addStartMessage(const std::string &message, int id)
te::vp::OperationReport::addMessage
void addMessage(const std::string &message, const std::string &severity="", bool appendTime=false)
TEVPEXPORT
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
te::vp::OperationReport::m_reportStr
std::stringstream m_reportStr
Definition: OperationReport.h:80
te::vp::OperationReport::toString
std::string toString()
te::vp::OperationReport::m_clockTime
std::map< int, std::clock_t > m_clockTime
Definition: OperationReport.h:82
te::vp::OperationReport::addTitle
void addTitle(const std::string &message)
te::vp::OperationReport::OperationReport
OperationReport()
Default constructor.
te::vp::OperationReport::addKeyValueMessage
void addKeyValueMessage(const std::string &key, const std::string &value)
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::vp::OperationReport::~OperationReport
~OperationReport()
Virtual destructor.
te::vp::OperationReport::addEmptyLine
void addEmptyLine()
te::vp::OperationReport::addEndMessage
void addEndMessage(const std::string &message, int id)