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:
@@ -34,7 +34,6 @@ class SampleStatistic;
|
||||
|
||||
class SGPerformanceMonitor : public SGSubsystem
|
||||
{
|
||||
|
||||
public:
|
||||
SGPerformanceMonitor(SGSubsystemMgr* subSysMgr, SGPropertyNode_ptr root);
|
||||
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
|
||||
class SGEventMgr;
|
||||
|
||||
class SGTimer {
|
||||
class SGTimer
|
||||
{
|
||||
public:
|
||||
~SGTimer();
|
||||
void run();
|
||||
|
||||
|
||||
std::string name;
|
||||
double interval;
|
||||
SGCallback* callback;
|
||||
@@ -20,7 +21,8 @@ public:
|
||||
bool running;
|
||||
};
|
||||
|
||||
class SGTimerQueue {
|
||||
class SGTimerQueue
|
||||
{
|
||||
public:
|
||||
SGTimerQueue(int preSize=1);
|
||||
~SGTimerQueue();
|
||||
@@ -37,8 +39,9 @@ public:
|
||||
double nextTime() { return -_table[0].pri; }
|
||||
|
||||
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
|
||||
@@ -50,9 +53,9 @@ private:
|
||||
int rchild(int n) { return ((n+1)*2 + 1) - 1; }
|
||||
double pri(int n) { return _table[n].pri; }
|
||||
void swap(int a, int b) {
|
||||
HeapEntry tmp = _table[a];
|
||||
_table[a] = _table[b];
|
||||
_table[b] = tmp;
|
||||
HeapEntry tmp = _table[a];
|
||||
_table[a] = _table[b];
|
||||
_table[b] = tmp;
|
||||
}
|
||||
void siftDown(int n);
|
||||
void siftUp(int n);
|
||||
@@ -77,6 +80,7 @@ public:
|
||||
virtual void update(double delta_time_sec);
|
||||
virtual void unbind();
|
||||
virtual void shutdown();
|
||||
|
||||
void setRealtimeProperty(SGPropertyNode* node) { _rtProp = node; }
|
||||
|
||||
/**
|
||||
@@ -119,8 +123,9 @@ public:
|
||||
|
||||
|
||||
void removeTask(const std::string& name);
|
||||
|
||||
|
||||
void dump();
|
||||
|
||||
private:
|
||||
friend class SGTimer;
|
||||
|
||||
@@ -130,7 +135,7 @@ private:
|
||||
|
||||
SGPropertyNode_ptr _freezeProp;
|
||||
SGPropertyNode_ptr _rtProp;
|
||||
SGTimerQueue _rtQueue;
|
||||
SGTimerQueue _rtQueue;
|
||||
SGTimerQueue _simQueue;
|
||||
bool _inited, _shutdown;
|
||||
};
|
||||
|
||||
@@ -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:
|
||||
@@ -342,24 +343,24 @@ public:
|
||||
protected:
|
||||
friend class SGSubsystemMgr;
|
||||
friend class SGSubsystemGroup;
|
||||
|
||||
|
||||
void set_name(const std::string& n);
|
||||
|
||||
void set_group(SGSubsystemGroup* group);
|
||||
|
||||
|
||||
/// composite name for the subsystem (type name and instance name if this
|
||||
/// is an instanced subsystem. (Since this member was originally defined as
|
||||
/// protected, not private, we can't rename it easily)
|
||||
std::string _name;
|
||||
|
||||
bool _suspended = false;
|
||||
|
||||
eventTimeVec timingInfo;
|
||||
bool _suspended = false;
|
||||
|
||||
static SGSubsystemTimingCb reportTimingCb;
|
||||
static void* reportTimingUserData;
|
||||
static bool reportTimingStatsRequest;
|
||||
static int maxTimePerFrame_ms;
|
||||
eventTimeVec timingInfo;
|
||||
|
||||
static SGSubsystemTimingCb reportTimingCb;
|
||||
static void* reportTimingUserData;
|
||||
static bool reportTimingStatsRequest;
|
||||
static int maxTimePerFrame_ms;
|
||||
|
||||
private:
|
||||
SGSubsystemGroup* _group = nullptr;
|
||||
@@ -416,9 +417,9 @@ public:
|
||||
*/
|
||||
void set_fixed_update_time(double fixed_dt);
|
||||
|
||||
/**
|
||||
* retrive list of member subsystem names
|
||||
*/
|
||||
/**
|
||||
* retrive list of member subsystem names
|
||||
*/
|
||||
string_list member_names() const;
|
||||
|
||||
template<class T>
|
||||
@@ -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);
|
||||
@@ -575,11 +577,11 @@ public:
|
||||
SOFT,
|
||||
PROPERTY
|
||||
};
|
||||
|
||||
|
||||
std::string name;
|
||||
Type type;
|
||||
};
|
||||
|
||||
|
||||
using DependencyVec = std::vector<SGSubsystemMgr::Dependency>;
|
||||
using SubsystemFactoryFunctor = std::function<SGSubsystemRef()>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user