std:: namespace fixes, and sink some code from the subsystem header into the implementation. (Hopefully more to follow)

This commit is contained in:
James Turner
2011-11-13 20:34:39 +00:00
parent 906ef85d90
commit 63ccb3df4c
6 changed files with 36 additions and 44 deletions

View File

@@ -15,9 +15,11 @@ You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef __GNUG__
#pragma implementation
#ifdef HAVE_CONFIG_H
#include <simgear_config.h>
#endif
#include <iostream>
#include <fstream>
#include "SGSmplhist.hxx"
@@ -94,7 +96,7 @@ int SampleHistogram::similarSamples (double d)
return (0);
}
void SampleHistogram::printBuckets (ostream & s)
void SampleHistogram::printBuckets (std::ostream & s)
{
for (int i = 0; i < howManyBuckets; i++)
{

View File

@@ -16,13 +16,7 @@ License along with this library; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <simgear_config.h>
#endif
#ifndef SampleHistogram_h
#ifdef __GNUG__
#pragma interface
#endif
#define SampleHistogram_h 1
#include <iosfwd>

View File

@@ -15,9 +15,6 @@ You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef __GNUG__
#pragma implementation
#endif
#include <math.h>

View File

@@ -16,17 +16,13 @@ License along with this library; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef SampleStatistic_h
#ifdef __GNUG__
#pragma interface
#endif
#define SampleStatistic_h 1
#undef min
#undef max
using namespace std;
class SampleStatistic
{
protected:

View File

@@ -29,7 +29,7 @@
#include "subsystem_mgr.hxx"
#include <simgear/math/SGMath.hxx>
#include "SGSmplstat.hxx"
const int SG_MAX_SUBSYSTEM_EXCEPTIONS = 4;
////////////////////////////////////////////////////////////////////////
@@ -132,6 +132,32 @@ void SGSubsystem::stamp(const string& name)
// Implementation of SGSubsystemGroup.
////////////////////////////////////////////////////////////////////////
class SGSubsystemGroup::Member
{
private:
Member (const Member &member);
public:
Member ();
virtual ~Member ();
virtual void update (double delta_time_sec);
void printTimingInformation(double time);
void printTimingStatistics(double minMaxTime=0.0,double minJitter=0.0);
void updateExecutionTime(double time);
double getTimeWarningThreshold();
void collectDebugTiming (bool collect) { collectTimeStats = collect; };
SampleStatistic timeStat;
std::string name;
SGSubsystem * subsystem;
double min_step_sec;
double elapsed_sec;
bool collectTimeStats;
int exceptionCount;
};
SGSubsystemGroup::SGSubsystemGroup () :
_fixedUpdateTime(-1.0),
_updateTimeRemainder(0.0)

View File

@@ -1,3 +1,4 @@
// Written by David Megginson, started 2000-12
//
// Copyright (C) 2000 David Megginson, david@megginson.com
@@ -31,7 +32,6 @@
#include <simgear/timing/timestamp.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include "SGSmplstat.hxx"
class TimingInfo
@@ -331,31 +331,8 @@ public:
void set_fixed_update_time(double fixed_dt);
private:
class Member {
private:
Member (const Member &member);
public:
Member ();
virtual ~Member ();
virtual void update (double delta_time_sec);
void printTimingInformation(double time);
void printTimingStatistics(double minMaxTime=0.0,double minJitter=0.0);
void updateExecutionTime(double time);
double getTimeWarningThreshold();
void collectDebugTiming (bool collect) { collectTimeStats = collect; };
SampleStatistic timeStat;
std::string name;
SGSubsystem * subsystem;
double min_step_sec;
double elapsed_sec;
bool collectTimeStats;
int exceptionCount;
};
Member * get_member (const std::string &name, bool create = false);
class Member;
Member* get_member (const std::string &name, bool create = false);
std::vector<Member *> _members;