X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2Fsubsystem_mgr.hxx;h=02332056a7dbda213890486a71368adf8e7e2e74;hb=c37b27a926b150bc0a63b23ccebddc6d56607bf1;hp=996846f9f3f62902e0ad91882a4f64b2e6bd69e1;hpb=9dc1b5f6f56c6fecdcfefc2a0a75695a89f323a2;p=simgear.git diff --git a/simgear/structure/subsystem_mgr.hxx b/simgear/structure/subsystem_mgr.hxx index 996846f9..02332056 100644 --- a/simgear/structure/subsystem_mgr.hxx +++ b/simgear/structure/subsystem_mgr.hxx @@ -25,25 +25,13 @@ #include -#if 0 -#ifdef HAVE_WINDOWS_H -# include -# include -#endif - -#include STL_STRING -SG_USING_STD(string); - -#include -SG_USING_STD(vector); -#endif - #include #include #include -SG_USING_STD(map); -SG_USING_STD(vector); -SG_USING_STD(string); + +using std::map; +using std::vector; +using std::string; #include #include @@ -57,9 +45,11 @@ private: SGTimeStamp time; public: - TimingInfo(string name, SGTimeStamp &t) { eventName = name; time = t;}; - string getName() { return eventName; }; - SGTimeStamp getTime() { return time; }; + TimingInfo(const string& name, const SGTimeStamp &t) : + eventName(name), time(t) + { } + const string& getName() const { return eventName; } + const SGTimeStamp& getTime() const { return time; } }; typedef vector eventTimeVec; @@ -283,7 +273,7 @@ public: * Place time stamps at strategic points in the execution of subsystems * update() member functions. Predominantly for debugging purposes. */ - void stamp(string name); + void stamp(const string& name); @@ -327,12 +317,18 @@ public: void collectDebugTiming(bool collect); + /** + * + */ + void set_fixed_update_time(double fixed_dt); private: - struct Member { + class Member { - Member (); + private: Member (const Member &member); + public: + Member (); virtual ~Member (); virtual void update (double delta_time_sec); @@ -353,6 +349,9 @@ private: Member * get_member (const string &name, bool create = false); vector _members; + + double _fixedUpdateTime; + double _updateTimeRemainder; }; @@ -384,6 +383,9 @@ public: enum GroupType { INIT = 0, GENERAL, + FDM, ///< flight model, autopilot, instruments that run coupled + POST_FDM, ///< certain subsystems depend on FDM data + DISPLAY, ///< view, camera, rendering updates MAX_GROUPS };