]> git.mxchange.org Git - flightgear.git/blob - src/Main/logger.hxx
Clean up header file use of iostream and "using" declarations
[flightgear.git] / src / Main / logger.hxx
1 // logger.hxx - log properties.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain, and comes with no warranty.
5
6 #ifndef __LOGGER_HXX
7 #define __LOGGER_HXX 1
8
9 #ifndef __cplusplus
10 # error This library requires C++
11 #endif
12
13 #ifdef HAVE_CONFIG_H
14 #  include <config.h>
15 #endif
16
17 #include <iosfwd>
18 #include <vector>
19
20 #include <simgear/compiler.h>
21 #include <simgear/debug/logstream.hxx>
22 #include <simgear/structure/exception.hxx>
23 #include <simgear/structure/subsystem_mgr.hxx>
24 #include <simgear/props/props.hxx>
25
26 /**
27  * Log any property values to any number of CSV files.
28  */
29 class FGLogger : public SGSubsystem
30 {
31 public:
32
33   FGLogger ();
34   virtual ~FGLogger ();
35
36                                 // Implementation of SGSubsystem
37   virtual void init ();
38   virtual void reinit ();
39   virtual void bind ();
40   virtual void unbind ();
41   virtual void update (double dt);
42
43 private:
44
45   /**
46    * A single instance of a log file (the logger can contain many).
47    */
48   struct Log {
49     Log ();
50     virtual ~Log ();
51     std::vector<SGPropertyNode_ptr> nodes;
52     std::ostream * output;
53     long interval_ms;
54     double last_time_ms;
55     char delimiter;
56   };
57
58   std::vector<Log> _logs;
59
60 };
61
62 #endif // __LOGGER_HXX