#ifndef __LOGGER_HXX
#define __LOGGER_HXX 1
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <simgear/compiler.h>
-#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/exception.hxx>
-#include <simgear/misc/props.hxx>
-
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-#include <iostream>
-SG_USING_STD(ostream);
-#endif
-
+#include <iosfwd>
#include <vector>
-SG_USING_STD(vector);
-
-#include "fgfs.hxx"
+#include <simgear/compiler.h>
+#include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/props/props.hxx>
/**
* Log any property values to any number of CSV files.
*/
-class FGLogger : public FGSubsystem
+class FGLogger : public SGSubsystem
{
public:
FGLogger ();
virtual ~FGLogger ();
- // Implementation of FGSubsystem
+ // Implementation of SGSubsystem
virtual void init ();
+ virtual void reinit ();
virtual void bind ();
virtual void unbind ();
- virtual void update (int dt);
+ virtual void update (double dt);
private:
struct Log {
Log ();
virtual ~Log ();
- vector<SGPropertyNode *> nodes;
- ostream * output;
+ std::vector<SGPropertyNode_ptr> nodes;
+ std::ostream * output;
long interval_ms;
- long last_time_ms;
+ double last_time_ms;
char delimiter;
};
- vector<Log> _logs;
+ std::vector<Log> _logs;
};