ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MyTool.h
Go to the documentation of this file.
1 #ifndef MYTOOL_H
2 #define MYTOOL_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "Tool.h"
8 #include "Stopwatch.h"
9 
10 
20 class MyTool: public Tool {
21 
22 
23  public:
24 
25  MyTool();
26  bool Initialise(std::string configfile,DataModel &data);
27  bool Execute();
28  bool Finalise();
29 
30 
31  private:
32 
33 
37  std::string m_stopwatch_file;
38 
40  int m_verbose;
41 
43  std::stringstream m_ss;
44 
47  void StreamToLog(int level) {
48  Log(m_ss.str(), level, m_verbose);
49  m_ss.str("");
50  }
51 
53  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
54 
55 
56 };
57 
58 
59 #endif
MyTool()
Simple constructor.
Definition: MyTool.cpp:3
Definition: MyTool.h:20
std::stringstream m_ss
For easy formatting of Log messages.
Definition: MyTool.h:43
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
Definition: MyTool.h:35
bool Finalise()
Finalise funciton used to clean up resorces.
Definition: MyTool.cpp:52
void StreamToLog(int level)
Definition: MyTool.h:47
int m_verbose
Verbosity level, as defined in tool parameter file.
Definition: MyTool.h:40
std::string m_stopwatch_file
Image filename to save the histogram to, if required.
Definition: MyTool.h:37
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
Definition: Utilities.cpp:276
bool Initialise(std::string configfile, DataModel &data)
Initialise Function for setting up Tool resorces.
Definition: MyTool.cpp:6
LogLevel
Log level enumerations.
Definition: MyTool.h:53
bool Execute()
Executre function used to perform Tool perpose.
Definition: MyTool.cpp:40