SGSubsystem classes: Whitespace standardisation of the declarations.

This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs.  It includes all SGSubsystem and SGSubsystemGroup derived classes.
This commit is contained in:
Edward d'Auvergne 2018-04-03 11:59:46 +02:00
parent d8a46cffa5
commit b73dfb08ae
9 changed files with 209 additions and 212 deletions

View File

@ -28,11 +28,9 @@ namespace simgear
namespace canvas namespace canvas
{ {
class CanvasMgr: class CanvasMgr : public PropertyBasedMgr
public PropertyBasedMgr
{ {
public: public:
/** /**
* @param node Root node of branch used to control canvasses * @param node Root node of branch used to control canvasses
*/ */
@ -61,7 +59,6 @@ namespace canvas
CanvasPtr getCanvas(const std::string& name) const; CanvasPtr getCanvas(const std::string& name) const;
protected: protected:
void elementCreated(PropertyBasedElementPtr element) override; void elementCreated(PropertyBasedElementPtr element) override;
}; };

View File

@ -30,7 +30,8 @@
// code can register another one immediately without worrying about // code can register another one immediately without worrying about
// timer aliasing. // timer aliasing.
class SGInterpolator : public SGSubsystem { class SGInterpolator : public SGSubsystem
{
public: public:
SGInterpolator() { _list = 0; } SGInterpolator() { _list = 0; }
virtual void init() {} virtual void init() {}

View File

@ -29,8 +29,7 @@
namespace simgear namespace simgear
{ {
class PropertyBasedMgr: class PropertyBasedMgr : public SGSubsystem,
public SGSubsystem,
public SGPropertyChangeListener public SGPropertyChangeListener
{ {
public: public:
@ -63,7 +62,6 @@ namespace simgear
virtual const SGPropertyNode* getPropertyRoot() const; virtual const SGPropertyNode* getPropertyRoot() const;
protected: protected:
typedef boost::function<PropertyBasedElementPtr(SGPropertyNode*)> typedef boost::function<PropertyBasedElementPtr(SGPropertyNode*)>
ElementFactory; ElementFactory;
@ -95,7 +93,6 @@ namespace simgear
SGPropertyNode * child ) override; SGPropertyNode * child ) override;
virtual void elementCreated(PropertyBasedElementPtr element) {} virtual void elementCreated(PropertyBasedElementPtr element) {}
}; };
} // namespace simgear } // namespace simgear

View File

@ -28,8 +28,7 @@
#include <list> #include <list>
namespace simgear namespace simgear {
{
/** /**
* Subsystem that manages interpolation of properties. * Subsystem that manages interpolation of properties.
@ -45,8 +44,7 @@ namespace simgear
* By default "linear" (constant animation speed) and "swing" (smooth * By default "linear" (constant animation speed) and "swing" (smooth
* acceleration and deceleration) are available. * acceleration and deceleration) are available.
*/ */
class PropertyInterpolationMgr: class PropertyInterpolationMgr : public SGSubsystem
public SGSubsystem
{ {
public: public:
typedef PropertyInterpolator* (*InterpolatorFactory)(); typedef PropertyInterpolator* (*InterpolatorFactory)();
@ -106,8 +104,7 @@ namespace simgear
template <class T> template <class T>
void addInterpolatorFactory(const std::string& type) void addInterpolatorFactory(const std::string& type)
{ {
addInterpolatorFactory addInterpolatorFactory(
(
type, type,
&simgear::make_new_derived<PropertyInterpolator, T> &simgear::make_new_derived<PropertyInterpolator, T>
); );
@ -126,7 +123,6 @@ namespace simgear
void setRealtimeProperty(SGPropertyNode* node); void setRealtimeProperty(SGPropertyNode* node);
protected: protected:
typedef std::map<std::string, InterpolatorFactory> InterpolatorFactoryMap; typedef std::map<std::string, InterpolatorFactory> InterpolatorFactoryMap;
typedef std::map<std::string, easing_func_t> EasingFunctionMap; typedef std::map<std::string, easing_func_t> EasingFunctionMap;
typedef std::pair<SGPropertyNode*, typedef std::pair<SGPropertyNode*,

View File

@ -39,7 +39,6 @@ class BufferedLogCallback;
class SGTerraSync : public SGSubsystem class SGTerraSync : public SGSubsystem
{ {
public: public:
SGTerraSync(); SGTerraSync();
virtual ~SGTerraSync(); virtual ~SGTerraSync();
@ -80,6 +79,7 @@ public:
void scheduleDataDir(const std::string& dataDir); void scheduleDataDir(const std::string& dataDir);
bool isDataDirPending(const std::string& dataDir) const; bool isDataDirPending(const std::string& dataDir) const;
protected: protected:
void syncAirportsModels(); void syncAirportsModels();
string_list getSceneryPathSuffixes() const; string_list getSceneryPathSuffixes() const;

View File

@ -49,7 +49,6 @@ class SGSoundSample;
class SGSoundMgr : public SGSubsystem class SGSoundMgr : public SGSubsystem
{ {
public: public:
SGSoundMgr(); SGSoundMgr();
~SGSoundMgr(); ~SGSoundMgr();
@ -325,6 +324,7 @@ public:
bool testForError(std::string s, std::string name = "sound manager"); bool testForError(std::string s, std::string name = "sound manager");
static const char* subsystemName() { return "sound"; }; static const char* subsystemName() { return "sound"; };
private: private:
class SoundManagerPrivate; class SoundManagerPrivate;
/// private implementation object /// private implementation object

View File

@ -34,7 +34,6 @@ class SampleStatistic;
class SGPerformanceMonitor : public SGSubsystem class SGPerformanceMonitor : public SGSubsystem
{ {
public: public:
SGPerformanceMonitor(SGSubsystemMgr* subSysMgr, SGPropertyNode_ptr root); SGPerformanceMonitor(SGSubsystemMgr* subSysMgr, SGPropertyNode_ptr root);

View File

@ -8,7 +8,8 @@
class SGEventMgr; class SGEventMgr;
class SGTimer { class SGTimer
{
public: public:
~SGTimer(); ~SGTimer();
void run(); void run();
@ -20,7 +21,8 @@ public:
bool running; bool running;
}; };
class SGTimerQueue { class SGTimerQueue
{
public: public:
SGTimerQueue(int preSize=1); SGTimerQueue(int preSize=1);
~SGTimerQueue(); ~SGTimerQueue();
@ -39,6 +41,7 @@ public:
SGTimer* findByName(const std::string& name) const; SGTimer* findByName(const std::string& name) const;
void dump(); void dump();
private: private:
// The "priority" is stored as a negative time. This allows the // The "priority" is stored as a negative time. This allows the
// implementation to treat the "top" of the heap as the largest // implementation to treat the "top" of the heap as the largest
@ -77,6 +80,7 @@ public:
virtual void update(double delta_time_sec); virtual void update(double delta_time_sec);
virtual void unbind(); virtual void unbind();
virtual void shutdown(); virtual void shutdown();
void setRealtimeProperty(SGPropertyNode* node) { _rtProp = node; } void setRealtimeProperty(SGPropertyNode* node) { _rtProp = node; }
/** /**
@ -121,6 +125,7 @@ public:
void removeTask(const std::string& name); void removeTask(const std::string& name);
void dump(); void dump();
private: private:
friend class SGTimer; friend class SGTimer;

View File

@ -127,6 +127,7 @@ typedef void (*SGSubsystemTimingCb)(void* userData, const std::string& name, Sam
* subsystems may also override the suspend() and resume() methods to * subsystems may also override the suspend() and resume() methods to
* take different actions.</p> * take different actions.</p>
*/ */
class SGSubsystem : public SGReferenced class SGSubsystem : public SGReferenced
{ {
public: public:
@ -431,6 +432,7 @@ public:
{ return true; } { return true; }
SGSubsystemMgr* get_manager() const override; SGSubsystemMgr* get_manager() const override;
private: private:
void forEach(std::function<void(SGSubsystem*)> f); void forEach(std::function<void(SGSubsystem*)> f);
void reverseForEach(std::function<void(SGSubsystem*)> f); void reverseForEach(std::function<void(SGSubsystem*)> f);