LogFile.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/genutil/LogFile.h
10 
11 #ifndef __LogFile_h
12 #define __LogFile_h
13 
14 #include "Reference.h"
15 #include <map>
16 
18 class LogFile : public Reference::Able
19 {
20  public:
21 
23  LogFile () {}
24 
26  LogFile (const std::string& filename);
27 
29  void add (const std::string& index, const std::string& message);
30 
32  std::string get_message (const std::string& index);
33 
34  protected:
35 
36  typedef std::map<std::string,std::string> container;
37  container messages;
38 };
39 
40 #endif
A list of strings indexed by another string.
Definition: LogFile.h:18
void add(const std::string &index, const std::string &message)
add a log message
Definition: LogFile.C:39
std::string get_message(const std::string &index)
get a log message
Definition: LogFile.C:50
A convenient exception handling class.
Definition: Error.h:54
LogFile()
Null constructor.
Definition: LogFile.h:28
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40

Generated using doxygen 1.8.17