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