typedef std::vector<SGGeod> SGGeodVec;
+class PagedPathForHistory : public SGReferenced {
+public:
+ PagedPathForHistory() : last_seen(0) {}
+ virtual ~PagedPathForHistory() {}
+ SGGeodVec path;
+ time_t last_seen;
+};
+typedef SGSharedPtr<PagedPathForHistory> PagedPathForHistory_ptr;
+
+const unsigned int SAMPLE_BUCKET_WIDTH = 1024;
+
/**
* record the history of the aircraft's movements, making it available
* as a contiguous block. This can be used to show the historical flight-path
virtual void reinit();
virtual void update(double dt);
+ PagedPathForHistory_ptr pagedPathForHistory(size_t max_entries, size_t newerThan = 0) const;
/**
* retrieve the path, collapsing segments shorter than
* the specified minimum length
*/
SGGeodVec pathForHistory(double minEdgeLengthM = 50.0) const;
+
+ /**
+ * clear the history
+ */
+
+ void clear();
+
private:
/**
* @class A single data sample in the history system.
/// heading, pitch and roll can be recorded at lower precision
/// than a double - actually 16 bits might be sufficient
float heading, pitch, roll;
- int simTimeMSec;
+ size_t simTimeMSec;
};
- static const int SAMPLE_BUCKET_WIDTH = 1024;
+
/**
* Bucket is a fixed-size container of samples. This is a crude slab
unsigned int m_validSampleCount;
SGPropertyNode_ptr m_weightOnWheels;
+ SGPropertyNode_ptr m_enabled;
+
bool m_lastWoW;
-
+ size_t m_maxMemoryUseBytes;
+
void allocateNewBucket();
- void clear();
void capture();
+
+ size_t currentMemoryUseBytes() const;
};
-#endif
\ No newline at end of file
+#endif