]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/subsystem_mgr.hxx
Command-manager supports functors.
[simgear.git] / simgear / structure / subsystem_mgr.hxx
index a0e76809c8a3522ddff53b49927248442ab21eff..1919db4b458d1a116a88a4bd2b8b37e9315ac86b 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <simgear/timing/timestamp.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
-
+#include <simgear/misc/strutils.hxx>
 
 class TimingInfo
 {
@@ -150,6 +150,13 @@ public:
    */
   virtual void init ();
 
+  typedef enum
+  {
+    INIT_DONE,      ///< subsystem is fully initialised
+    INIT_CONTINUE   ///< init should be called again
+  } InitStatus;
+  
+  virtual InitStatus incrementalInit ();
 
   /**
    * Initialize parts that depend on other subsystems having been initialized.
@@ -289,7 +296,8 @@ public:
     SGSubsystemGroup ();
     virtual ~SGSubsystemGroup ();
 
-    virtual void init ();
+    virtual void init();
+    virtual InitStatus incrementalInit ();
     virtual void postinit ();
     virtual void reinit ();
     virtual void shutdown ();
@@ -313,6 +321,12 @@ public:
      *
      */
     void set_fixed_update_time(double fixed_dt);
+        
+       /**
+        * retrive list of member subsystem names
+        */ 
+    string_list member_names() const;
+        
 private:
 
     class Member;
@@ -322,6 +336,9 @@ private:
     
     double _fixedUpdateTime;
     double _updateTimeRemainder;
+    
+  /// index of the member we are currently init-ing
+    unsigned int _initPosition;
 };
 
 
@@ -364,6 +381,7 @@ public:
     virtual ~SGSubsystemMgr ();
 
     virtual void init ();
+    virtual InitStatus incrementalInit ();
     virtual void postinit ();
     virtual void reinit ();
     virtual void shutdown ();
@@ -394,7 +412,8 @@ public:
 
 private:
     SGSubsystemGroup* _groups[MAX_GROUPS];
-
+    unsigned int _initPosition;
+  
     typedef std::map<std::string, SGSubsystem*> SubsystemDict;
     SubsystemDict _subsystem_map;
 };