SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LogFile.h
Go to the documentation of this file.
1 #ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
2 
3 /*
4  For more information, please see: http://software.sci.utah.edu
5 
6  The MIT License
7 
8  Copyright (c) 2009 Scientific Computing and Imaging Institute,
9  University of Utah.
10 
11 
12  Permission is hereby granted, free of charge, to any person obtaining a
13  copy of this software and associated documentation files (the "Software"),
14  to deal in the Software without restriction, including without limitation
15  the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  and/or sell copies of the Software, and to permit persons to whom the
17  Software is furnished to do so, subject to the following conditions:
18 
19  The above copyright notice and this permission notice shall be included
20  in all copies or substantial portions of the Software.
21 
22  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  DEALINGS IN THE SOFTWARE.
29 */
30 /// @todo Documentation Core/Utils/Legacy/LogFile.h
31 
32 ///@file LogFile.h
33 
34 
35 #ifndef CORE_UTIL_LOGFILE_H
36 #define CORE_UTIL_LOGFILE_H 1
37 
38 #include <fstream>
39 #include <string>
40 
41 #include <Core/Util/share.h>
42 
43 namespace SCIRun {
44 
45 class SCISHARE LogFile
46 {
47 public:
48  // Create a log file, that can used by multiple threads without
49  // the log becoming a mesh
50  explicit LogFile(const std::string& filename);
51 
52  // Since we used a ofstream, this one is automatically closed when the
53  // object is destroyed.
54 
55  // Write a message into the log
56  void putmsg(const std::string& msg);
57 private:
58  std::ofstream logfile_;
59  bool haslog_;
60 };
61 
62 typedef boost::shared_ptr<LogFile> LogFileHandle;
63 
64 }
65 
66 #endif
67 
68 #endif
#define msg(m)
Definition: PiecewiseInterp.h:55
#define SCISHARE
Definition: share.h:39