SGSubsystemGroup: Removal of the subsystem group naming.

This is a partial reversion of c1dd8faa29 and a
complete reversion of caea68007e and
846f024e91.  These changes are incompatible with
the subsystem class IDs.
This commit is contained in:
Edward d'Auvergne 2019-06-13 17:56:39 +02:00
parent d7323f5f19
commit 991fafb839
3 changed files with 13 additions and 15 deletions

View File

@ -233,12 +233,11 @@ public:
SGSubsystemGroup::SGSubsystemGroup(const char *name) : SGSubsystemGroup::SGSubsystemGroup() :
_fixedUpdateTime(-1.0), _fixedUpdateTime(-1.0),
_updateTimeRemainder(0.0), _updateTimeRemainder(0.0),
_initPosition(-1) _initPosition(-1)
{ {
_name = name;
} }
SGSubsystemGroup::~SGSubsystemGroup () SGSubsystemGroup::~SGSubsystemGroup ()
@ -838,7 +837,7 @@ namespace {
} // end of anonymous namespace } // end of anonymous namespace
SGSubsystemMgr::SGSubsystemMgr (const char *name) : SGSubsystemMgr::SGSubsystemMgr () :
_groups(MAX_GROUPS) _groups(MAX_GROUPS)
{ {
if (global_defaultSubsystemManager == nullptr) { if (global_defaultSubsystemManager == nullptr) {
@ -855,7 +854,7 @@ SGSubsystemMgr::SGSubsystemMgr (const char *name) :
#endif #endif
for (int i = 0; i < MAX_GROUPS; i++) { for (int i = 0; i < MAX_GROUPS; i++) {
auto g = new SGSubsystemGroup(name); auto g = new SGSubsystemGroup();
g->set_manager(this); g->set_manager(this);
_groups[i].reset(g); _groups[i].reset(g);
} }

View File

@ -384,7 +384,7 @@ typedef SGSharedPtr<SGSubsystem> SGSubsystemRef;
class SGSubsystemGroup : public SGSubsystem class SGSubsystemGroup : public SGSubsystem
{ {
public: public:
SGSubsystemGroup (const char *name); SGSubsystemGroup ();
virtual ~SGSubsystemGroup (); virtual ~SGSubsystemGroup ();
// Subsystem API. // Subsystem API.
@ -509,7 +509,7 @@ public:
MAX_GROUPS MAX_GROUPS
}; };
SGSubsystemMgr (const char *name); SGSubsystemMgr ();
virtual ~SGSubsystemMgr (); virtual ~SGSubsystemMgr ();
// Subsystem API. // Subsystem API.

View File

@ -89,7 +89,6 @@ public:
class InstrumentGroup : public SGSubsystemGroup class InstrumentGroup : public SGSubsystemGroup
{ {
public: public:
InstrumentGroup() : SGSubsystemGroup(InstrumentGroup::staticSubsystemClassId()) {}
static const char* staticSubsystemClassId() { return "instruments"; } static const char* staticSubsystemClassId() { return "instruments"; }
virtual ~InstrumentGroup() virtual ~InstrumentGroup()
@ -165,7 +164,7 @@ SGSubsystemMgr::InstancedRegistrant<FakeRadioSub> registrant3(SGSubsystemMgr::PO
void testRegistrationAndCreation() void testRegistrationAndCreation()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST1"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto anotherSub = manager->create<AnotherSub>(); auto anotherSub = manager->create<AnotherSub>();
SG_VERIFY(anotherSub); SG_VERIFY(anotherSub);
@ -182,7 +181,7 @@ void testRegistrationAndCreation()
void testAddGetRemove() void testAddGetRemove()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST1"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto d = new RecorderDelegate; auto d = new RecorderDelegate;
manager->addDelegate(d); manager->addDelegate(d);
@ -229,7 +228,7 @@ void testAddGetRemove()
void testSubGrouping() void testSubGrouping()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST1"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto d = new RecorderDelegate; auto d = new RecorderDelegate;
manager->addDelegate(d); manager->addDelegate(d);
@ -300,7 +299,7 @@ void testSubGrouping()
void testIncrementalInit() void testIncrementalInit()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto d = new RecorderDelegate; auto d = new RecorderDelegate;
manager->addDelegate(d); manager->addDelegate(d);
@ -348,7 +347,7 @@ void testEmptyGroup()
// https://sourceforge.net/p/flightgear/codetickets/2043/ // https://sourceforge.net/p/flightgear/codetickets/2043/
// when an empty group is inited, we skipped setting the state // when an empty group is inited, we skipped setting the state
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto d = new RecorderDelegate; auto d = new RecorderDelegate;
manager->addDelegate(d); manager->addDelegate(d);
@ -372,7 +371,7 @@ void testEmptyGroup()
void testSuspendResume() void testSuspendResume()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto d = new RecorderDelegate; auto d = new RecorderDelegate;
manager->addDelegate(d); manager->addDelegate(d);
@ -442,7 +441,7 @@ void testSuspendResume()
void testPropertyRoot() void testPropertyRoot()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
SGPropertyNode_ptr props(new SGPropertyNode); SGPropertyNode_ptr props(new SGPropertyNode);
manager->set_root_node(props); manager->set_root_node(props);
@ -468,7 +467,7 @@ void testPropertyRoot()
void testAddRemoveAfterInit() void testAddRemoveAfterInit()
{ {
SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr("TEST"); SGSharedPtr<SGSubsystemMgr> manager = new SGSubsystemMgr();
auto d = new RecorderDelegate; auto d = new RecorderDelegate;
manager->addDelegate(d); manager->addDelegate(d);