diff --git a/docs-mini/README.introduction b/docs-mini/README.introduction index 0e84a491f..1e3be0f4f 100644 --- a/docs-mini/README.introduction +++ b/docs-mini/README.introduction @@ -65,7 +65,7 @@ SGSubsystem and define at least a small set of functions: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "subsystem-example"; } + static const char* staticSubsystemClassId() { return "subsystem-example"; } }; The init() functions should make sure everything is set and ready so the diff --git a/src/AIModel/AIManager.hxx b/src/AIModel/AIManager.hxx index ae292b598..d386d862f 100644 --- a/src/AIModel/AIManager.hxx +++ b/src/AIModel/AIManager.hxx @@ -51,7 +51,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "ai-model"; } + static const char* staticSubsystemClassId() { return "ai-model"; } void updateLOD(SGPropertyNode* node); void attach(FGAIBase *model); diff --git a/src/AIModel/performancedb.hxx b/src/AIModel/performancedb.hxx index 9075eaa39..8479d897b 100644 --- a/src/AIModel/performancedb.hxx +++ b/src/AIModel/performancedb.hxx @@ -31,7 +31,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "aircraft-performance-db"; } + static const char* staticSubsystemClassId() { return "aircraft-performance-db"; } bool havePerformanceDataForAircraftType(const std::string& acType) const; diff --git a/src/Aircraft/controls.hxx b/src/Aircraft/controls.hxx index 6c7cb35a4..080de7d74 100644 --- a/src/Aircraft/controls.hxx +++ b/src/Aircraft/controls.hxx @@ -265,7 +265,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "controls"; } + static const char* staticSubsystemClassId() { return "controls"; } // Reset function void reset_all(void); diff --git a/src/Aircraft/replay.hxx b/src/Aircraft/replay.hxx index 3f559740f..b0315cd65 100644 --- a/src/Aircraft/replay.hxx +++ b/src/Aircraft/replay.hxx @@ -73,7 +73,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "replay"; } + static const char* staticSubsystemClassId() { return "replay"; } bool start(bool NewTape=false); diff --git a/src/Airports/airportdynamicsmanager.hxx b/src/Airports/airportdynamicsmanager.hxx index 195c34fc2..c0c013d81 100644 --- a/src/Airports/airportdynamicsmanager.hxx +++ b/src/Airports/airportdynamicsmanager.hxx @@ -45,7 +45,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "airport-dynamics"; } + static const char* staticSubsystemClassId() { return "airport-dynamics"; } static FGAirportDynamicsRef find(const std::string& icao); diff --git a/src/Autopilot/route_mgr.hxx b/src/Autopilot/route_mgr.hxx index 2f2ecd6f7..cd58b25fa 100644 --- a/src/Autopilot/route_mgr.hxx +++ b/src/Autopilot/route_mgr.hxx @@ -53,7 +53,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "route-manager"; } + static const char* staticSubsystemClassId() { return "route-manager"; } bool isRouteActive() const; diff --git a/src/Canvas/canvas_mgr.hxx b/src/Canvas/canvas_mgr.hxx index 4cc92c11f..175727073 100644 --- a/src/Canvas/canvas_mgr.hxx +++ b/src/Canvas/canvas_mgr.hxx @@ -32,7 +32,7 @@ public: void shutdown() override; // Subsystem identification. - static const char* subsystemName() { return "Canvas"; } + static const char* staticSubsystemClassId() { return "Canvas"; } /** * Get OpenGL texture name for given canvas diff --git a/src/Environment/ephemeris.hxx b/src/Environment/ephemeris.hxx index 648ef199d..7ae410e10 100644 --- a/src/Environment/ephemeris.hxx +++ b/src/Environment/ephemeris.hxx @@ -48,7 +48,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "ephemeris"; } + static const char* staticSubsystemClassId() { return "ephemeris"; } SGEphemeris* data(); diff --git a/src/FDM/fdm_shell.hxx b/src/FDM/fdm_shell.hxx index 8753f95de..a64bdd1a7 100644 --- a/src/FDM/fdm_shell.hxx +++ b/src/FDM/fdm_shell.hxx @@ -54,7 +54,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "flight"; } + static const char* staticSubsystemClassId() { return "flight"; } FGInterface* getInterface() const; diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index d49102478..09f6060e8 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -49,7 +49,7 @@ public: void update(double delta_time_sec) override; // Subsystem identification. - static const char* subsystemName() { return "gui"; } + static const char* staticSubsystemClassId() { return "gui"; } /** * Redraw the GUI picking up new GUI colors. diff --git a/src/Input/FGHIDEventInput.hxx b/src/Input/FGHIDEventInput.hxx index 4b1e05c45..cbfe09cbc 100644 --- a/src/Input/FGHIDEventInput.hxx +++ b/src/Input/FGHIDEventInput.hxx @@ -47,7 +47,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "input-hid"; } + static const char* staticSubsystemClassId() { return "input-hid"; } private: class FGHIDEventInputPrivate; diff --git a/src/Input/FGMouseInput.hxx b/src/Input/FGMouseInput.hxx index 87f41b35d..f3d7b3edb 100644 --- a/src/Input/FGMouseInput.hxx +++ b/src/Input/FGMouseInput.hxx @@ -52,7 +52,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "input-mouse"; } + static const char* staticSubsystemClassId() { return "input-mouse"; } void doMouseClick (int b, int updown, int x, int y, bool mainWindow, const osgGA::GUIEventAdapter* ea); void doMouseMotion (int x, int y, const osgGA::GUIEventAdapter*); diff --git a/src/Input/input.cxx b/src/Input/input.cxx index fb84d8e23..3b994be42 100644 --- a/src/Input/input.cxx +++ b/src/Input/input.cxx @@ -62,7 +62,7 @@ FGInput::FGInput () : SGSubsystemGroup("FGInput") if( fgGetBool("/sim/input/no-mouse-input",false) ) { SG_LOG(SG_INPUT,SG_ALERT,"Mouse input disabled!"); } else { - set_subsystem( FGMouseInput::subsystemName(), new FGMouseInput() ); + set_subsystem( FGMouseInput::staticSubsystemClassId(), new FGMouseInput() ); } if( fgGetBool("/sim/input/no-keyboard-input",false) ) { diff --git a/src/Input/input.hxx b/src/Input/input.hxx index 1fd9fbe6b..79aca4aae 100644 --- a/src/Input/input.hxx +++ b/src/Input/input.hxx @@ -56,7 +56,7 @@ public: virtual ~FGInput(); // Subsystem identification. - static const char* subsystemName() { return "input"; } + static const char* staticSubsystemClassId() { return "input"; } }; #endif // _INPUT_HXX diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 6d4e32796..96a027457 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -1153,7 +1153,7 @@ void fgStartNewReset() SGSubsystemGroup* grp = subsystemManger->get_group(static_cast(g)); for (auto nm : grp->member_names()) { if ((nm == "time") || (nm == "terrasync") || (nm == "events") - || (nm == "lighting") || (nm == FGScenery::subsystemName())) + || (nm == "lighting") || (nm == FGScenery::staticSubsystemClassId())) { continue; } @@ -1176,7 +1176,7 @@ void fgStartNewReset() // order is important here since tile-manager shutdown needs to // access the scenery object - subsystemManger->remove(FGScenery::subsystemName()); + subsystemManger->remove(FGScenery::staticSubsystemClassId()); FGScenery::getPagerSingleton()->clearRequests(); flightgear::CameraGroup::setDefault(NULL); diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 13076eb4d..cb602cfd4 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -213,7 +213,7 @@ FGGlobals::~FGGlobals() } osgDB::Registry::instance()->clearObjectCache(); - subsystem_mgr->remove(FGScenery::subsystemName()); + subsystem_mgr->remove(FGScenery::staticSubsystemClassId()); // renderer touches subsystems during its destruction set_renderer(NULL); diff --git a/src/Main/globals.hxx b/src/Main/globals.hxx index c513da338..e8d1c4cf4 100644 --- a/src/Main/globals.hxx +++ b/src/Main/globals.hxx @@ -174,7 +174,7 @@ public: template T* get_subsystem() const { - return dynamic_cast(get_subsystem(T::subsystemName())); + return dynamic_cast(get_subsystem(T::staticSubsystemClassId())); } @@ -190,7 +190,7 @@ public: double min_time_sec = 0) { T* sub = new T; - add_subsystem(T::subsystemName(), sub, type, min_time_sec); + add_subsystem(T::staticSubsystemClassId(), sub, type, min_time_sec); return sub; } diff --git a/src/Model/acmodel.hxx b/src/Model/acmodel.hxx index 66ed0b54c..96745ba20 100644 --- a/src/Model/acmodel.hxx +++ b/src/Model/acmodel.hxx @@ -33,7 +33,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "aircraft-model"; } + static const char* staticSubsystemClassId() { return "aircraft-model"; } virtual SGModelPlacement * get3DModel() { return _aircraft.get(); } virtual SGVec3d& getVelocity() { return _velocity; } diff --git a/src/Model/modelmgr.hxx b/src/Model/modelmgr.hxx index f3dbfd467..59a7f5009 100644 --- a/src/Model/modelmgr.hxx +++ b/src/Model/modelmgr.hxx @@ -62,7 +62,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "model-manager"; } + static const char* staticSubsystemClassId() { return "model-manager"; } virtual void add_model (SGPropertyNode * node); diff --git a/src/Network/DNSClient.hxx b/src/Network/DNSClient.hxx index 875783676..5e26df5af 100644 --- a/src/Network/DNSClient.hxx +++ b/src/Network/DNSClient.hxx @@ -38,7 +38,7 @@ public: void update(double) override; // Subsystem identification. - static const char* subsystemName() { return "dns"; } + static const char* staticSubsystemClassId() { return "dns"; } void makeRequest(const simgear::DNS::Request_ptr& req); diff --git a/src/Network/HTTPClient.hxx b/src/Network/HTTPClient.hxx index 2bb166c6a..640fff7b3 100644 --- a/src/Network/HTTPClient.hxx +++ b/src/Network/HTTPClient.hxx @@ -38,7 +38,7 @@ public: void update(double) override; // Subsystem identification. - static const char* subsystemName() { return "http"; } + static const char* staticSubsystemClassId() { return "http"; } void makeRequest(const simgear::HTTP::Request_ptr& req); diff --git a/src/Scenery/scenery.hxx b/src/Scenery/scenery.hxx index 4262a4a54..73fe319ce 100644 --- a/src/Scenery/scenery.hxx +++ b/src/Scenery/scenery.hxx @@ -80,7 +80,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "scenery"; } + static const char* staticSubsystemClassId() { return "scenery"; } /// Compute the elevation of the scenery at geodetic latitude lat, /// geodetic longitude lon and not higher than max_alt. diff --git a/src/Scenery/terrain_pgt.hxx b/src/Scenery/terrain_pgt.hxx index b91483287..85d8ad4da 100644 --- a/src/Scenery/terrain_pgt.hxx +++ b/src/Scenery/terrain_pgt.hxx @@ -111,7 +111,7 @@ public: bool schedule_scenery(const SGGeod& position, double range_m, double duration=0.0); void materialLibChanged(); - static const char* subsystemName() { return "scenery"; } + static const char* staticSubsystemClassId() { return "scenery"; } private: // terrain branch of scene graph diff --git a/src/Scenery/terrain_stg.hxx b/src/Scenery/terrain_stg.hxx index af7c3b490..e0165fc01 100644 --- a/src/Scenery/terrain_stg.hxx +++ b/src/Scenery/terrain_stg.hxx @@ -109,7 +109,7 @@ public: bool schedule_scenery(const SGGeod& position, double range_m, double duration=0.0); void materialLibChanged(); - static const char* subsystemName() { return "scenery"; } + static const char* staticSubsystemClassId() { return "scenery"; } private: // tile manager diff --git a/src/Scripting/NasalSys.hxx b/src/Scripting/NasalSys.hxx index d6e316189..8b3e3fe23 100644 --- a/src/Scripting/NasalSys.hxx +++ b/src/Scripting/NasalSys.hxx @@ -44,7 +44,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "nasal"; } + static const char* staticSubsystemClassId() { return "nasal"; } // Loads a nasal script from an external file and inserts it as a // global module of the specified name. diff --git a/src/Sound/soundmanager.hxx b/src/Sound/soundmanager.hxx index 607f77ef1..94810a6be 100644 --- a/src/Sound/soundmanager.hxx +++ b/src/Sound/soundmanager.hxx @@ -45,7 +45,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "sound"; } + static const char* staticSubsystemClassId() { return "sound"; } void activate(bool State); void update_device_list(); @@ -81,7 +81,7 @@ public: void update(double dt) {} override // Subsystem identification. - static const char* subsystemName() { return "sound"; } + static const char* staticSubsystemClassId() { return "sound"; } }; #endif // ENABLE_AUDIO_SUPPORT diff --git a/src/Time/TimeManager.hxx b/src/Time/TimeManager.hxx index 5b821e941..677590232 100644 --- a/src/Time/TimeManager.hxx +++ b/src/Time/TimeManager.hxx @@ -43,7 +43,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "time"; } + static const char* staticSubsystemClassId() { return "time"; } void computeTimeDeltas(double& simDt, double& realDt); diff --git a/src/Viewer/viewmgr.hxx b/src/Viewer/viewmgr.hxx index 7a5f7f921..85b0267b3 100644 --- a/src/Viewer/viewmgr.hxx +++ b/src/Viewer/viewmgr.hxx @@ -59,7 +59,7 @@ public: void update(double dt) override; // Subsystem identification. - static const char* subsystemName() { return "view-manager"; } + static const char* staticSubsystemClassId() { return "view-manager"; } // getters inline int size() const { return views.size(); }