From 991fafb839063c854fb6e783c1efbf32816f8f19 Mon Sep 17 00:00:00 2001 From: Edward d'Auvergne Date: Thu, 13 Jun 2019 17:56:39 +0200 Subject: [PATCH] SGSubsystemGroup: Removal of the subsystem group naming. This is a partial reversion of c1dd8faa29136b30272e26042d24f079d5ec2b7c and a complete reversion of caea68007e0ef217d29c8b7432a7c712936b3e56 and 846f024e91252657313585455ac8dbfc5dbe9657. These changes are incompatible with the subsystem class IDs. --- simgear/structure/subsystem_mgr.cxx | 7 +++---- simgear/structure/subsystem_mgr.hxx | 4 ++-- simgear/structure/subsystem_test.cxx | 17 ++++++++--------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/simgear/structure/subsystem_mgr.cxx b/simgear/structure/subsystem_mgr.cxx index 6efcb2ad..6ceff02e 100644 --- a/simgear/structure/subsystem_mgr.cxx +++ b/simgear/structure/subsystem_mgr.cxx @@ -233,12 +233,11 @@ public: -SGSubsystemGroup::SGSubsystemGroup(const char *name) : +SGSubsystemGroup::SGSubsystemGroup() : _fixedUpdateTime(-1.0), _updateTimeRemainder(0.0), _initPosition(-1) { - _name = name; } SGSubsystemGroup::~SGSubsystemGroup () @@ -838,7 +837,7 @@ namespace { } // end of anonymous namespace -SGSubsystemMgr::SGSubsystemMgr (const char *name) : +SGSubsystemMgr::SGSubsystemMgr () : _groups(MAX_GROUPS) { if (global_defaultSubsystemManager == nullptr) { @@ -855,7 +854,7 @@ SGSubsystemMgr::SGSubsystemMgr (const char *name) : #endif for (int i = 0; i < MAX_GROUPS; i++) { - auto g = new SGSubsystemGroup(name); + auto g = new SGSubsystemGroup(); g->set_manager(this); _groups[i].reset(g); } diff --git a/simgear/structure/subsystem_mgr.hxx b/simgear/structure/subsystem_mgr.hxx index fc52ded9..af91dd4d 100644 --- a/simgear/structure/subsystem_mgr.hxx +++ b/simgear/structure/subsystem_mgr.hxx @@ -384,7 +384,7 @@ typedef SGSharedPtr SGSubsystemRef; class SGSubsystemGroup : public SGSubsystem { public: - SGSubsystemGroup (const char *name); + SGSubsystemGroup (); virtual ~SGSubsystemGroup (); // Subsystem API. @@ -509,7 +509,7 @@ public: MAX_GROUPS }; - SGSubsystemMgr (const char *name); + SGSubsystemMgr (); virtual ~SGSubsystemMgr (); // Subsystem API. diff --git a/simgear/structure/subsystem_test.cxx b/simgear/structure/subsystem_test.cxx index c75149ee..266b7fdd 100644 --- a/simgear/structure/subsystem_test.cxx +++ b/simgear/structure/subsystem_test.cxx @@ -89,7 +89,6 @@ public: class InstrumentGroup : public SGSubsystemGroup { public: - InstrumentGroup() : SGSubsystemGroup(InstrumentGroup::staticSubsystemClassId()) {} static const char* staticSubsystemClassId() { return "instruments"; } virtual ~InstrumentGroup() @@ -165,7 +164,7 @@ SGSubsystemMgr::InstancedRegistrant registrant3(SGSubsystemMgr::PO void testRegistrationAndCreation() { - SGSharedPtr manager = new SGSubsystemMgr("TEST1"); + SGSharedPtr manager = new SGSubsystemMgr(); auto anotherSub = manager->create(); SG_VERIFY(anotherSub); @@ -182,7 +181,7 @@ void testRegistrationAndCreation() void testAddGetRemove() { - SGSharedPtr manager = new SGSubsystemMgr("TEST1"); + SGSharedPtr manager = new SGSubsystemMgr(); auto d = new RecorderDelegate; manager->addDelegate(d); @@ -229,7 +228,7 @@ void testAddGetRemove() void testSubGrouping() { - SGSharedPtr manager = new SGSubsystemMgr("TEST1"); + SGSharedPtr manager = new SGSubsystemMgr(); auto d = new RecorderDelegate; manager->addDelegate(d); @@ -300,7 +299,7 @@ void testSubGrouping() void testIncrementalInit() { - SGSharedPtr manager = new SGSubsystemMgr("TEST"); + SGSharedPtr manager = new SGSubsystemMgr(); auto d = new RecorderDelegate; manager->addDelegate(d); @@ -348,7 +347,7 @@ void testEmptyGroup() // https://sourceforge.net/p/flightgear/codetickets/2043/ // when an empty group is inited, we skipped setting the state - SGSharedPtr manager = new SGSubsystemMgr("TEST"); + SGSharedPtr manager = new SGSubsystemMgr(); auto d = new RecorderDelegate; manager->addDelegate(d); @@ -372,7 +371,7 @@ void testEmptyGroup() void testSuspendResume() { - SGSharedPtr manager = new SGSubsystemMgr("TEST"); + SGSharedPtr manager = new SGSubsystemMgr(); auto d = new RecorderDelegate; manager->addDelegate(d); @@ -442,7 +441,7 @@ void testSuspendResume() void testPropertyRoot() { - SGSharedPtr manager = new SGSubsystemMgr("TEST"); + SGSharedPtr manager = new SGSubsystemMgr(); SGPropertyNode_ptr props(new SGPropertyNode); manager->set_root_node(props); @@ -468,7 +467,7 @@ void testPropertyRoot() void testAddRemoveAfterInit() { - SGSharedPtr manager = new SGSubsystemMgr("TEST"); + SGSharedPtr manager = new SGSubsystemMgr(); auto d = new RecorderDelegate; manager->addDelegate(d);