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
{
class CanvasMgr:
public PropertyBasedMgr
{
public:
class CanvasMgr : public PropertyBasedMgr
{
public:
/**
* @param node Root node of branch used to control canvasses
*/
@ -60,10 +58,9 @@ namespace canvas
*/
CanvasPtr getCanvas(const std::string& name) const;
protected:
protected:
void elementCreated(PropertyBasedElementPtr element) override;
};
};
} // namespace canvas
} // namespace simgear

View File

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

View File

@ -29,15 +29,14 @@
namespace simgear
{
class PropertyBasedMgr:
public SGSubsystem,
class PropertyBasedMgr : public SGSubsystem,
public SGPropertyChangeListener
{
public:
{
public:
void init() override;
void shutdown() override;
void update (double delta_time_sec) override;
void update(double delta_time_sec) override;
/**
* Create a new PropertyBasedElement
@ -62,8 +61,7 @@ namespace simgear
virtual const SGPropertyNode* getPropertyRoot() const;
protected:
protected:
typedef boost::function<PropertyBasedElementPtr(SGPropertyNode*)>
ElementFactory;
@ -95,8 +93,7 @@ namespace simgear
SGPropertyNode * child ) override;
virtual void elementCreated(PropertyBasedElementPtr element) {}
};
};
} // namespace simgear

View File

@ -28,10 +28,9 @@
#include <list>
namespace simgear
{
namespace simgear {
/**
/**
* Subsystem that manages interpolation of properties.
*
* By default the numeric values of the properties are interpolated. For
@ -45,10 +44,9 @@ namespace simgear
* By default "linear" (constant animation speed) and "swing" (smooth
* acceleration and deceleration) are available.
*/
class PropertyInterpolationMgr:
public SGSubsystem
{
public:
class PropertyInterpolationMgr : public SGSubsystem
{
public:
typedef PropertyInterpolator* (*InterpolatorFactory)();
PropertyInterpolationMgr();
@ -70,10 +68,10 @@ namespace simgear
* @param easing Type of easing ("linear", "swing", etc.)
*/
PropertyInterpolator*
createInterpolator( const std::string& type,
createInterpolator(const std::string& type,
const SGPropertyNode& target,
double duration,
const std::string& easing );
const std::string& easing);
/**
* Add animation of the given property from its current value to the
@ -83,31 +81,30 @@ namespace simgear
* @param prop Property to be interpolated
* @param interp Interpolator used for interpolation
*/
bool interpolate( SGPropertyNode* prop,
PropertyInterpolatorRef interp = 0 );
bool interpolate(SGPropertyNode* prop,
PropertyInterpolatorRef interp = 0);
bool interpolate( SGPropertyNode* prop,
bool interpolate(SGPropertyNode* prop,
const std::string& type,
const SGPropertyNode& target,
double duration,
const std::string& easing );
const std::string& easing);
bool interpolate( SGPropertyNode* prop,
bool interpolate(SGPropertyNode* prop,
const std::string& type,
const PropertyList& values,
const double_list& deltas,
const std::string& easing );
const std::string& easing);
/**
* Register factory for interpolation type.
*/
void addInterpolatorFactory( const std::string& type,
InterpolatorFactory factory );
template<class T>
void addInterpolatorFactory(const std::string& type,
InterpolatorFactory factory);
template <class T>
void addInterpolatorFactory(const std::string& type)
{
addInterpolatorFactory
(
addInterpolatorFactory(
type,
&simgear::make_new_derived<PropertyInterpolator, T>
);
@ -125,12 +122,11 @@ namespace simgear
*/
void setRealtimeProperty(SGPropertyNode* node);
protected:
protected:
typedef std::map<std::string, InterpolatorFactory> InterpolatorFactoryMap;
typedef std::map<std::string, easing_func_t> EasingFunctionMap;
typedef std::pair< SGPropertyNode*,
PropertyInterpolatorRef > PropertyInterpolatorPair;
typedef std::pair<SGPropertyNode*,
PropertyInterpolatorRef> PropertyInterpolatorPair;
typedef std::list<PropertyInterpolatorPair> InterpolatorList;
struct PredicateIsSameProp;
@ -140,7 +136,7 @@ namespace simgear
InterpolatorList _interpolators;
SGPropertyNode_ptr _rt_prop;
};
};
} // namespace simgear

View File

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

View File

@ -49,7 +49,6 @@ class SGSoundSample;
class SGSoundMgr : public SGSubsystem
{
public:
SGSoundMgr();
~SGSoundMgr();
@ -325,6 +324,7 @@ 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

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

View File

@ -8,7 +8,8 @@
class SGEventMgr;
class SGTimer {
class SGTimer
{
public:
~SGTimer();
void run();
@ -20,7 +21,8 @@ public:
bool running;
};
class SGTimerQueue {
class SGTimerQueue
{
public:
SGTimerQueue(int preSize=1);
~SGTimerQueue();
@ -39,6 +41,7 @@ public:
SGTimer* findByName(const std::string& name) const;
void dump();
private:
// The "priority" is stored as a negative time. This allows the
// 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 unbind();
virtual void shutdown();
void setRealtimeProperty(SGPropertyNode* node) { _rtProp = node; }
/**
@ -121,6 +125,7 @@ public:
void removeTask(const std::string& name);
void dump();
private:
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
* take different actions.</p>
*/
class SGSubsystem : public SGReferenced
{
public:
@ -431,6 +432,7 @@ public:
{ return true; }
SGSubsystemMgr* get_manager() const override;
private:
void forEach(std::function<void(SGSubsystem*)> f);
void reverseForEach(std::function<void(SGSubsystem*)> f);