]> git.mxchange.org Git - flightgear.git/blob - src/Main/logger.hxx
header cleanups
[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 #include <iosfwd>
10 #include <vector>
11
12 #include <simgear/compiler.h>
13 #include <simgear/structure/subsystem_mgr.hxx>
14
15 /**
16  * Log any property values to any number of CSV files.
17  */
18 class FGLogger : public SGSubsystem
19 {
20 public:
21
22   FGLogger ();
23   virtual ~FGLogger ();
24
25                                 // Implementation of SGSubsystem
26   virtual void init ();
27   virtual void reinit ();
28   virtual void bind ();
29   virtual void unbind ();
30   virtual void update (double dt);
31
32 private:
33
34   /**
35    * A single instance of a log file (the logger can contain many).
36    */
37   struct Log {
38     Log ();
39     virtual ~Log ();
40     std::vector<SGPropertyNode_ptr> nodes;
41     std::ostream * output;
42     long interval_ms;
43     double last_time_ms;
44     char delimiter;
45   };
46
47   std::vector<Log> _logs;
48
49 };
50
51 #endif // __LOGGER_HXX