SGSubsystem classes: Subsystem and subsystem group API declaration standardisation.

This is a cleanup commit.
This commit is contained in:
Edward d'Auvergne 2018-04-03 11:45:18 +02:00
parent b73dfb08ae
commit 10662e4ca5
8 changed files with 55 additions and 50 deletions

View File

@ -34,8 +34,9 @@ class SGInterpolator : public SGSubsystem
{
public:
SGInterpolator() { _list = 0; }
virtual void init() {}
virtual void update(double delta_time_sec);
// Subsystem API.
void update(double delta_time_sec) override;
// Simple method that interpolates a double property value from
// its current value (default of zero) to the specified target

View File

@ -33,9 +33,9 @@ class PropertyBasedMgr : public SGSubsystem,
public SGPropertyChangeListener
{
public:
// Subsystem API.
void init() override;
void shutdown() override;
void update(double delta_time_sec) override;
/**

View File

@ -51,10 +51,8 @@ public:
PropertyInterpolationMgr();
/**
* Update all active interpolators.
*/
void update(double dt);
// Subsystem API.
void update(double dt) override;
/**
* Create a new property interpolator.

View File

@ -42,12 +42,13 @@ public:
SGTerraSync();
virtual ~SGTerraSync();
virtual void init();
virtual void shutdown();
virtual void reinit();
virtual void bind();
virtual void unbind();
virtual void update(double);
// Subsystem API.
void bind() override;
void init() override;
void reinit() override;
void shutdown() override;
void unbind() override;
void update(double) override;
/// notify terrasync that the sim was repositioned, as opposed to
/// us travelling in a direction. Avoid last_lat / last_lon blocking

View File

@ -52,15 +52,18 @@ public:
SGSoundMgr();
~SGSoundMgr();
void init();
void update(double dt);
// Subsystem API.
void init() override;
void reinit() override;
void resume() override;
void suspend() override;
void update(double dt) override;
// Subsystem identification.
static const char* subsystemName() { return "sound"; }
void suspend();
void resume();
void stop();
void reinit();
/**
* Select a specific sound device.
* Requires a init/reinit call before sound is actually switched.
@ -323,8 +326,6 @@ public:
bool testForError(std::string s, std::string name = "sound manager");
static const char* subsystemName() { return "sound"; };
private:
class SoundManagerPrivate;
/// private implementation object

View File

@ -37,10 +37,11 @@ class SGPerformanceMonitor : public SGSubsystem
public:
SGPerformanceMonitor(SGSubsystemMgr* subSysMgr, SGPropertyNode_ptr root);
virtual void bind (void);
virtual void unbind (void);
virtual void init (void);
virtual void update (double dt);
// Subsystem API.
void bind() override;
void init() override;
void unbind() override;
void update(double dt) override;
private:
static void subSystemMgrHook(void* userData, const std::string& name, SampleStatistic* timeStat);

View File

@ -76,10 +76,11 @@ public:
SGEventMgr();
~SGEventMgr();
virtual void init();
virtual void update(double delta_time_sec);
virtual void unbind();
virtual void shutdown();
// Subsystem API.
void init() override;
void shutdown() override;
void unbind() override;
void update(double delta_time_sec) override;
void setRealtimeProperty(SGPropertyNode* node) { _rtProp = node; }

View File

@ -382,16 +382,17 @@ public:
SGSubsystemGroup (const char *name);
virtual ~SGSubsystemGroup ();
void init() override;
// Subsystem API.
void bind() override;
InitStatus incrementalInit() override;
void init() override;
void postinit() override;
void reinit() override;
void resume() override;
void shutdown() override;
void bind () override;
void suspend() override;
void unbind() override;
void update(double delta_time_sec) override;
void suspend () override;
void resume () override;
bool is_suspended() const override;
virtual void set_subsystem (const std::string &name,
@ -506,16 +507,17 @@ public:
SGSubsystemMgr (const char *name);
virtual ~SGSubsystemMgr ();
// Subsystem API.
void bind() override;
void init() override;
InitStatus incrementalInit() override;
void postinit() override;
void reinit() override;
void resume() override;
void shutdown() override;
void bind () override;
void suspend() override;
void unbind() override;
void update(double delta_time_sec) override;
void suspend () override;
void resume () override;
bool is_suspended() const override;
virtual void add (const char * name,