pd_scopelogger.h
Go to the documentation of this file.
1 /** @file pd_scopelogger.h Create Logfile */
2 
3 /* Pushdown plugin for FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2014 Ramon Barakat, Stefan Jacobi, Sven Schneider, Anne-Kathrin Hess
6 
7 */
8 
9 #ifndef FAUDES_PD_SCOPELOGGER_H
10 #define FAUDES_PD_SCOPELOGGER_H
11 
12 #include "corefaudes.h"
13 #include "pd_include.h"
14 
15 #include <ctime>
16 
17 
18 namespace faudes {
19 
20 #ifdef FAUDES_PD_PRINT_LOGFILE
21 #define FUNCTION(x) ScopeLogger l_##x##_scope(x);
22 #else
23 #define FUNCTION(x)
24 #endif
25 
26 /**
27  * Class to create a log file which contains function calls with their runtime
28  */
30 
31 private:
32  static int indent;
33  static std::ofstream outputFile;
34  static time_t starttime;
35 
36  public:
37  std::string msg;
38  time_t startFuntime;
39  static std::vector<ScopeLogger*> vFunTrace;
40  static std::stringstream stFunDone;
41 
42  /**
43  * Constructor
44  */
45  ScopeLogger( std::string const & msg );
46 
47  /**
48  * Deconstructor
49  */
50  ~ScopeLogger();
51 
52  /*
53  * Print current stack trace
54  */
55  void StackTrace();
56 
57 }; // end class ScopeLogger
58 
59 
60 } // namespace faudes
61 
62 #endif

libFAUDES 2.28c --- 2016.09.30 --- c++ api documentaion by doxygen