]> git.mxchange.org Git - flightgear.git/blobdiff - src/Aircraft/FlightHistory.hxx
Interim windows build fix
[flightgear.git] / src / Aircraft / FlightHistory.hxx
index 29b0fb1221a4fc977cf47450fed0b52403af8849..4f23bc9330f5dee2cfa0ef82f7fa8aca6080e686 100644 (file)
 
 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
@@ -50,11 +61,19 @@ public:
     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.
@@ -66,10 +85,10 @@ private:
         /// 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
@@ -94,12 +113,16 @@ private:
     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