Changed the rest of the c++0x auto's to iterator equivalents

This commit is contained in:
Mark Watkins 2011-06-02 14:42:37 +10:00
parent 51d53f0bc4
commit cd3ec94fe6
9 changed files with 70 additions and 70 deletions

View File

@ -7872,11 +7872,11 @@
<map> <map>
"tinyxml/tinyxml.h" "tinyxml/tinyxml.h"
1306927363 /home/mark/projects/git/sleepyhead/graphs/graph.h 1306988764 /home/mark/projects/git/sleepyhead/graphs/graph.h
<sleeplib/machine.h> <sleeplib/machine.h>
<list> <list>
1306988397 /home/mark/projects/git/sleepyhead/version.h 1306989702 /home/mark/projects/git/sleepyhead/version.h
1306724655 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h 1306724655 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h
"machine.h" "machine.h"
@ -7893,7 +7893,7 @@
"preferences.h" "preferences.h"
"tinyxml/tinyxml.h" "tinyxml/tinyxml.h"
1306984959 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp 1306988716 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
"wx_pch.h" "wx_pch.h"
"version.h" "version.h"
<wx/app.h> <wx/app.h>
@ -7912,7 +7912,7 @@
"sleeplib/profiles.h" "sleeplib/profiles.h"
"sleeplib/machine_loader.h" "sleeplib/machine_loader.h"
1306940744 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp 1306989181 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp
<wx/settings.h> <wx/settings.h>
<wx/dcbuffer.h> <wx/dcbuffer.h>
<wx/log.h> <wx/log.h>
@ -7937,10 +7937,10 @@
"profiles.h" "profiles.h"
<algorithm> <algorithm>
1306807233 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/machine_loader.cpp 1306989502 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/machine_loader.cpp
"machine_loader.h" "machine_loader.h"
1306414968 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/preferences.cpp 1306989695 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/preferences.cpp
<wx/wx.h> <wx/wx.h>
<wx/filename.h> <wx/filename.h>
<wx/string.h> <wx/string.h>
@ -7948,7 +7948,7 @@
<wx/stdpaths.h> <wx/stdpaths.h>
"preferences.h" "preferences.h"
1306807867 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/profiles.cpp 1306989333 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/profiles.cpp
<wx/filefn.h> <wx/filefn.h>
<wx/filename.h> <wx/filename.h>
<wx/utils.h> <wx/utils.h>
@ -7960,7 +7960,7 @@
"machine_loader.h" "machine_loader.h"
"tinyxml/tinyxml.h" "tinyxml/tinyxml.h"
1306941094 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp 1306989439 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp
<wx/dir.h> <wx/dir.h>
<wx/filename.h> <wx/filename.h>
<wx/ffile.h> <wx/ffile.h>

View File

@ -121,7 +121,7 @@ void SleepyHeadFrame::UpdateProfiles()
i=ProfileMenuID; i=ProfileMenuID;
for (auto p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) { for (map<wxString,Profile *>::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) {
Profile &pro=*(Profiles::profiles[p->first]); Profile &pro=*(Profiles::profiles[p->first]);
wxMenuItem *item=ProfileMenu->AppendRadioItem(i,pro["Realname"],wxEmptyString); wxMenuItem *item=ProfileMenu->AppendRadioItem(i,pro["Realname"],wxEmptyString);
@ -391,7 +391,7 @@ void Summary::ResetProfile(Profile *p)
EndDatePicker->SetRange(profile->FirstDay()+wxTimeSpan::Day(),profile->LastDay()+wxTimeSpan::Day()); EndDatePicker->SetRange(profile->FirstDay()+wxTimeSpan::Day(),profile->LastDay()+wxTimeSpan::Day());
StartDatePicker->SetValue(profile->FirstDay()+wxTimeSpan::Day()); StartDatePicker->SetValue(profile->FirstDay()+wxTimeSpan::Day());
EndDatePicker->SetValue(profile->LastDay()+wxTimeSpan::Day()); EndDatePicker->SetValue(profile->LastDay()+wxTimeSpan::Day());
for (auto h=Data.begin();h!=Data.end();h++) { for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
(*h)->SetProfile(p); (*h)->SetProfile(p);
(*h)->ResetDateRange(); (*h)->ResetDateRange();
} }
@ -400,7 +400,7 @@ void Summary::ResetProfile(Profile *p)
} }
void Summary::RefreshData() void Summary::RefreshData()
{ {
for (auto h=Data.begin();h!=Data.end();h++) { for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
(*h)->Update(); (*h)->Update();
} }
@ -480,7 +480,7 @@ void Summary::OnRBSelect( wxCommandEvent& event )
StartDatePicker->SetValue(start); StartDatePicker->SetValue(start);
EndDatePicker->SetValue(end); EndDatePicker->SetValue(end);
for (auto h=Data.begin();h!=Data.end();h++) { for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
(*h)->SetDateRange(start-wxTimeSpan::Day(),end); (*h)->SetDateRange(start-wxTimeSpan::Day(),end);
} }
} }
@ -489,7 +489,7 @@ void Summary::OnStartDateChanged( wxDateEvent& event )
{ {
wxDateTime start=StartDatePicker->GetValue()-wxTimeSpan::Days(2); wxDateTime start=StartDatePicker->GetValue()-wxTimeSpan::Days(2);
wxDateTime end=EndDatePicker->GetValue()-wxTimeSpan::Day(); wxDateTime end=EndDatePicker->GetValue()-wxTimeSpan::Day();
for (auto h=Data.begin();h!=Data.end();h++) { for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
(*h)->SetDateRange(start,end); (*h)->SetDateRange(start,end);
} }
} }
@ -497,7 +497,7 @@ void Summary::OnEndDateChanged( wxDateEvent& event )
{ {
wxDateTime start=StartDatePicker->GetValue()-wxTimeSpan::Days(2); wxDateTime start=StartDatePicker->GetValue()-wxTimeSpan::Days(2);
wxDateTime end=EndDatePicker->GetValue()-wxTimeSpan::Day(); wxDateTime end=EndDatePicker->GetValue()-wxTimeSpan::Day();
for (auto h=Data.begin();h!=Data.end();h++) { for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
(*h)->SetDateRange(start,end); (*h)->SetDateRange(start,end);
} }
} }
@ -818,7 +818,7 @@ void Daily::RefreshData()
//SessionList->Clear(); //SessionList->Clear();
for (auto i=d->begin();i!=d->end();i++) { for (vector<Session *>::iterator i=d->begin();i!=d->end();i++) {
//wxString a=wxString::Format(wxT("Session %i"),(*i)->session()); //wxString a=wxString::Format(wxT("Session %i"),(*i)->session());
//SessionList->Append(a); //SessionList->Append(a);
@ -896,7 +896,7 @@ void Daily::UpdateGraphs(Day *day)
day->OpenWaveforms(); day->OpenWaveforms();
} }
for (auto g=Data.begin();g!=Data.end();g++) { for (list<gPointData *>::iterator g=Data.begin();g!=Data.end();g++) {
if (day==NULL) { if (day==NULL) {
(*g)->SetMinX(0); (*g)->SetMinX(0);
(*g)->SetMaxX(0); (*g)->SetMaxX(0);

View File

@ -45,7 +45,7 @@ gGraphData::~gGraphData()
void gGraphData::Update(Day *day) void gGraphData::Update(Day *day)
{ {
Reload(day); Reload(day);
for (auto i=notify_layers.begin();i!=notify_layers.end();i++) { for (list<gLayer *>::iterator i=notify_layers.begin();i!=notify_layers.end();i++) {
(*i)->DataChanged(this); (*i)->DataChanged(this);
} }
} }
@ -56,7 +56,7 @@ gPointData::gPointData(int mp)
} }
gPointData::~gPointData() gPointData::~gPointData()
{ {
for (auto i=point.begin();i!=point.end();i++) for (vector<wxRealPoint *>::iterator i=point.begin();i!=point.end();i++)
delete [] (*i); delete [] (*i);
} }
void gPointData::AddSegment(int max_points) void gPointData::AddSegment(int max_points)
@ -73,7 +73,7 @@ gPoint3DData::gPoint3DData(int mp)
} }
gPoint3DData::~gPoint3DData() gPoint3DData::~gPoint3DData()
{ {
for (auto i=point.begin();i!=point.end();i++) for (vector<Point3D *>::iterator i=point.begin();i!=point.end();i++)
delete [] (*i); delete [] (*i);
} }
void gPoint3DData::AddSegment(int mp) void gPoint3DData::AddSegment(int mp)
@ -141,7 +141,7 @@ gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & titl
} }
gGraphWindow::~gGraphWindow() gGraphWindow::~gGraphWindow()
{ {
for (auto l=layers.begin();l!=layers.end();l++) delete (*l); for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) delete (*l);
layers.clear(); layers.clear();
} }
@ -176,7 +176,7 @@ void gGraphWindow::ZoomXPixels(int x1, int x2)
{ {
double rx1=0,rx2=0; double rx1=0,rx2=0;
ZoomXPixels(x1,x2,rx1,rx2); ZoomXPixels(x1,x2,rx1,rx2);
for (auto g=link_zoom.begin();g!=link_zoom.end();g++) { for (list<gGraphWindow *>::iterator g=link_zoom.begin();g!=link_zoom.end();g++) {
(*g)->SetXBounds(rx1,rx2); (*g)->SetXBounds(rx1,rx2);
} }
@ -229,7 +229,7 @@ void gGraphWindow::MoveX(int i)
double min,max; double min,max;
MoveX(i,min,max); MoveX(i,min,max);
for (auto g=link_zoom.begin();g!=link_zoom.end();g++) { for (list<gGraphWindow *>::iterator g=link_zoom.begin();g!=link_zoom.end();g++) {
(*g)->SetXBounds(min,max); (*g)->SetXBounds(min,max);
} }
if (!m_block_zoom) SetXBounds(min,max); if (!m_block_zoom) SetXBounds(min,max);
@ -308,7 +308,7 @@ void gGraphWindow::OnMouseRightRelease(wxMouseEvent &event)
double zoom_fact=2; double zoom_fact=2;
if (event.ControlDown()) zoom_fact=5.0; if (event.ControlDown()) zoom_fact=5.0;
if (abs(event.GetX()-m_mouseRClick_start.x)<3 && abs(event.GetY()-m_mouseRClick_start.y)<3) { if (abs(event.GetX()-m_mouseRClick_start.x)<3 && abs(event.GetY()-m_mouseRClick_start.y)<3) {
for (auto g=link_zoom.begin();g!=link_zoom.end();g++) { for (list<gGraphWindow *>::iterator g=link_zoom.begin();g!=link_zoom.end();g++) {
(*g)->ZoomX(zoom_fact,0); (*g)->ZoomX(zoom_fact,0);
} }
if (!m_block_zoom) { if (!m_block_zoom) {
@ -344,7 +344,7 @@ void gGraphWindow::OnMouseLeftRelease(wxMouseEvent &event)
} else { } else {
double zoom_fact=0.5; double zoom_fact=0.5;
if (event.ControlDown()) zoom_fact=0.25; if (event.ControlDown()) zoom_fact=0.25;
for (auto g=link_zoom.begin();g!=link_zoom.end();g++) { for (list<gGraphWindow *>::iterator g=link_zoom.begin();g!=link_zoom.end();g++) {
(*g)->ZoomX(zoom_fact,event.GetX()); (*g)->ZoomX(zoom_fact,event.GetX());
} }
if (!m_block_zoom) { if (!m_block_zoom) {
@ -396,7 +396,7 @@ void gGraphWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
//wxLogMessage(wxT("Paint")); //wxLogMessage(wxT("Paint"));
//dc.DrawText(m_title,m_marginLeft,3); //dc.DrawText(m_title,m_marginLeft,3);
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
(*l)->Plot(dc,*this); (*l)->Plot(dc,*this);
} }
@ -426,7 +426,7 @@ double gGraphWindow::MinX()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->MinX(); val=(*l)->MinX();
if (!((val==(*l)->MaxX()) && (val==0))) if (!((val==(*l)->MaxX()) && (val==0)))
@ -449,7 +449,7 @@ double gGraphWindow::MaxX()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->MaxX(); val=(*l)->MaxX();
if (!((val==(*l)->MinX()) && (val==0))) if (!((val==(*l)->MinX()) && (val==0)))
@ -472,7 +472,7 @@ double gGraphWindow::MinY()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->MinY(); val=(*l)->MinY();
if (!((val==(*l)->MaxY()) && (val==0))) if (!((val==(*l)->MaxY()) && (val==0)))
@ -494,7 +494,7 @@ double gGraphWindow::MaxY()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->MaxY(); val=(*l)->MaxY();
if (!((val==(*l)->MinY()) && (val==0))) if (!((val==(*l)->MinY()) && (val==0)))
@ -517,7 +517,7 @@ double gGraphWindow::RealMinX()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->RealMinX(); val=(*l)->RealMinX();
if (!((val==(*l)->RealMaxX()) && (val==0))) if (!((val==(*l)->RealMaxX()) && (val==0)))
@ -539,7 +539,7 @@ double gGraphWindow::RealMaxX()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->RealMaxX(); val=(*l)->RealMaxX();
if (!((val==(*l)->RealMinX()) && (val==0))) if (!((val==(*l)->RealMinX()) && (val==0)))
@ -561,7 +561,7 @@ double gGraphWindow::RealMinY()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->RealMinY(); val=(*l)->RealMinY();
if (!((val==(*l)->RealMaxY()) && (val==0))) if (!((val==(*l)->RealMaxY()) && (val==0)))
@ -583,7 +583,7 @@ double gGraphWindow::RealMaxY()
bool first=true; bool first=true;
double val,tmp; double val,tmp;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
if (first) { if (first) {
val=(*l)->RealMaxY(); val=(*l)->RealMaxY();
if (!((val==(*l)->RealMinY()) && (val==0))) // Does this create a loop?? if (!((val==(*l)->RealMinY()) && (val==0))) // Does this create a loop??
@ -601,28 +601,28 @@ double gGraphWindow::RealMaxY()
void gGraphWindow::SetMinX(double v) void gGraphWindow::SetMinX(double v)
{ {
min_x=v; min_x=v;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
(*l)->SetMinX(v); (*l)->SetMinX(v);
} }
} }
void gGraphWindow::SetMaxX(double v) void gGraphWindow::SetMaxX(double v)
{ {
max_x=v; max_x=v;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
(*l)->SetMaxX(v); (*l)->SetMaxX(v);
} }
} }
void gGraphWindow::SetMinY(double v) void gGraphWindow::SetMinY(double v)
{ {
min_y=v; min_y=v;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
(*l)->SetMinY(v); (*l)->SetMinY(v);
} }
} }
void gGraphWindow::SetMaxY(double v) void gGraphWindow::SetMaxY(double v)
{ {
max_y=v; max_y=v;
for (auto l=layers.begin();l!=layers.end();l++) { for (list<gLayer *>::iterator l=layers.begin();l!=layers.end();l++) {
(*l)->SetMaxY(v); (*l)->SetMaxY(v);
} }
} }
@ -1530,9 +1530,9 @@ void FlowData::Reload(Day *day)
max_x=day->last().GetMJD(); max_x=day->last().GetMJD();
max_y=0; max_y=0;
bool first=true; bool first=true;
for (auto s=day->begin();s!=day->end(); s++) { for (vector<Session *>::iterator s=day->begin();s!=day->end(); s++) {
if ((*s)->waveforms.find(code)==(*s)->waveforms.end()) continue; if ((*s)->waveforms.find(code)==(*s)->waveforms.end()) continue;
for (auto l=(*s)->waveforms[code].begin();l!=(*s)->waveforms[code].end();l++) { for (vector<Waveform *>::iterator l=(*s)->waveforms[code].begin();l!=(*s)->waveforms[code].end();l++) {
int ps=point.size(); int ps=point.size();
if (vc>=ps) { if (vc>=ps) {
AddSegment(max_points); // TODO: Add size limit capabilities. AddSegment(max_points); // TODO: Add size limit capabilities.
@ -1606,7 +1606,7 @@ void PressureData::Reload(Day *day)
min_y=max_y=0; min_y=max_y=0;
int tt=0; int tt=0;
bool first=true; bool first=true;
for (auto s=day->begin();s!=day->end(); s++) { for (vector<Session *>::iterator s=day->begin();s!=day->end(); s++) {
if ((*s)->events.find(code)==(*s)->events.end()) continue; if ((*s)->events.find(code)==(*s)->events.end()) continue;
if (vc>=(int)point.size()) { if (vc>=(int)point.size()) {
AddSegment(max_points); AddSegment(max_points);
@ -1614,7 +1614,7 @@ void PressureData::Reload(Day *day)
int t=0; int t=0;
EventDataType p; //,lastp=-1; EventDataType p; //,lastp=-1;
for (auto ev=(*s)->events[code].begin(); ev!=(*s)->events[code].end(); ev++) { for (vector<Event *>::iterator ev=(*s)->events[code].begin(); ev!=(*s)->events[code].end(); ev++) {
p=(*(*ev))[field]; p=(*(*ev))[field];
/*if (lastp>=0) { /*if (lastp>=0) {
wxRealPoint r2((*ev)->time().GetMJD(),lastp); wxRealPoint r2((*ev)->time().GetMJD(),lastp);
@ -1695,10 +1695,10 @@ void TAPData::Reload(Day *day)
int field=0; int field=0;
for (auto s=day->begin();s!=day->end();s++) { for (vector<Session *>::iterator s=day->begin();s!=day->end();s++) {
if ((*s)->events.find(code)==(*s)->events.end()) continue; if ((*s)->events.find(code)==(*s)->events.end()) continue;
first=true; first=true;
for (auto e=(*s)->events[code].begin(); e!=(*s)->events[code].end(); e++) { for (vector<Event *>::iterator e=(*s)->events[code].begin(); e!=(*s)->events[code].end(); e++) {
Event & ev =(*(*e)); Event & ev =(*(*e));
val=ev[field]*10.0; val=ev[field]*10.0;
if (field > ev.fields()) throw BoundsError(); if (field > ev.fields()) throw BoundsError();
@ -1785,10 +1785,10 @@ void FlagData::Reload(Day *day)
min_x=day->first().GetMJD(); min_x=day->first().GetMJD();
max_x=day->last().GetMJD(); max_x=day->last().GetMJD();
for (auto s=day->begin();s!=day->end();s++) { for (vector<Session *>::iterator s=day->begin();s!=day->end();s++) {
if ((*s)->events.find(code)==(*s)->events.end()) continue; if ((*s)->events.find(code)==(*s)->events.end()) continue;
first=true; first=true;
for (auto e=(*s)->events[code].begin(); e!=(*s)->events[code].end(); e++) { for (vector<Event *>::iterator e=(*s)->events[code].begin(); e!=(*s)->events[code].end(); e++) {
Event & ev =(*(*e)); Event & ev =(*(*e));
v2=v1=ev.time().GetMJD(); v2=v1=ev.time().GetMJD();
if (offset>=0) if (offset>=0)
@ -1863,7 +1863,7 @@ void HistoryData::Reload(Day *day)
y=0; y=0;
int z=0; int z=0;
vector<Day *> & daylist=profile->daylist[date]; vector<Day *> & daylist=profile->daylist[date];
for (auto dd=daylist.begin(); dd!=daylist.end(); dd++) { // average any multiple data sets for (vector<Day *>::iterator dd=daylist.begin(); dd!=daylist.end(); dd++) { // average any multiple data sets
Day *d=(*dd); Day *d=(*dd);
y=Calc(d); y=Calc(d);
z++; z++;
@ -1917,7 +1917,7 @@ void HistoryData::SetDateRange(wxDateTime start,wxDateTime end)
if (x2 > (real_max_x)) x2=(real_max_x); if (x2 > (real_max_x)) x2=(real_max_x);
min_x=x1; min_x=x1;
max_x=x2; max_x=x2;
for (auto i=notify_layers.begin();i!=notify_layers.end();i++) { for (list<gLayer *>::iterator i=notify_layers.begin();i!=notify_layers.end();i++) {
(*i)->DataChanged(this); (*i)->DataChanged(this);
} // Do nothing else.. Callers responsibility to Refresh window. } // Do nothing else.. Callers responsibility to Refresh window.
} }

View File

@ -241,7 +241,7 @@ class gLayer
virtual gPointData * GetData() { return data; }; virtual gPointData * GetData() { return data; };
virtual void DataChanged(gGraphData *src) { virtual void DataChanged(gGraphData *src) {
for (auto i=m_graph.begin();i!=m_graph.end();i++) for (list<gGraphWindow *>::iterator i=m_graph.begin();i!=m_graph.end();i++)
(*i)->DataChanged(this); (*i)->DataChanged(this);
}; // Notify signal sent from gGraphData.. pass on to the graph so it can que a refresh and update stuff. }; // Notify signal sent from gGraphData.. pass on to the graph so it can que a refresh and update stuff.

View File

@ -20,7 +20,7 @@ void RegisterLoader(MachineLoader *loader)
} }
void DestroyLoaders() void DestroyLoaders()
{ {
for (auto i=m_loaders.begin(); i!=m_loaders.end(); i++) { for (list<MachineLoader *>::iterator i=m_loaders.begin(); i!=m_loaders.end(); i++) {
delete (*i); delete (*i);
} }
m_loaders.clear(); m_loaders.clear();

View File

@ -75,7 +75,7 @@ Preferences::~Preferences()
int Preferences::GetCode(wxString s) int Preferences::GetCode(wxString s)
{ {
int prefcode=0; int prefcode=0;
for (auto i=p_codes.begin(); i!=p_codes.end(); i++) { for (std::map<int,wxString>::iterator i=p_codes.begin(); i!=p_codes.end(); i++) {
if (i->second==s) return i->first; if (i->second==s) return i->first;
prefcode++; prefcode++;
} }
@ -209,7 +209,7 @@ bool Preferences::Save(wxString filename)
TiXmlElement * msgs = new TiXmlElement(p_name.mb_str()); TiXmlElement * msgs = new TiXmlElement(p_name.mb_str());
root->LinkEndChild(msgs); root->LinkEndChild(msgs);
for (auto i=p_preferences.begin(); i!=p_preferences.end(); i++) { for (std::map<wxString,wxVariant>::iterator i=p_preferences.begin(); i!=p_preferences.end(); i++) {
msg=new TiXmlElement(i->first.mb_str()); msg=new TiXmlElement(i->first.mb_str());
wxString type=i->second.GetType(); wxString type=i->second.GetType();
msg->SetAttribute("type",type.mb_str()); msg->SetAttribute("type",type.mb_str());

View File

@ -46,13 +46,13 @@ Profile::Profile(wxString path)
Profile::~Profile() Profile::~Profile()
{ {
for (auto i=machlist.begin(); i!=machlist.end(); i++) { for (map<MachineID,Machine *>::iterator i=machlist.begin(); i!=machlist.end(); i++) {
delete i->second; delete i->second;
} }
} }
void Profile::LoadMachineData() void Profile::LoadMachineData()
{ {
for (auto i=machlist.begin(); i!=machlist.end(); i++) { for (map<MachineID,Machine *>::iterator i=machlist.begin(); i!=machlist.end(); i++) {
i->second->Load(); i->second->Load();
} }
} }
@ -106,7 +106,7 @@ void Profile::DelMachine(Machine *m) {
TiXmlElement * Profile::ExtraSave() TiXmlElement * Profile::ExtraSave()
{ {
TiXmlElement *mach=new TiXmlElement("Machines"); TiXmlElement *mach=new TiXmlElement("Machines");
for (auto i=machlist.begin(); i!=machlist.end(); i++) { for (map<MachineID,Machine *>::iterator i=machlist.begin(); i!=machlist.end(); i++) {
TiXmlElement *me=new TiXmlElement("Machine"); TiXmlElement *me=new TiXmlElement("Machine");
Machine *m=i->second; Machine *m=i->second;
//wxString t=wxT("0x")+m->hexid(); //wxString t=wxT("0x")+m->hexid();
@ -115,7 +115,7 @@ TiXmlElement * Profile::ExtraSave()
me->SetAttribute("class",m->GetClass().mb_str()); me->SetAttribute("class",m->GetClass().mb_str());
i->second->properties[wxT("path")]=wxT("{DataFolder}{sep}")+m->hexid(); i->second->properties[wxT("path")]=wxT("{DataFolder}{sep}")+m->hexid();
for (auto j=i->second->properties.begin(); j!=i->second->properties.end(); j++) { for (map<wxString,wxString>::iterator j=i->second->properties.begin(); j!=i->second->properties.end(); j++) {
TiXmlElement *mp=new TiXmlElement(j->first.mb_str()); TiXmlElement *mp=new TiXmlElement(j->first.mb_str());
mp->LinkEndChild(new TiXmlText(j->second.mb_str())); mp->LinkEndChild(new TiXmlText(j->second.mb_str()));
me->LinkEndChild(mp); me->LinkEndChild(mp);
@ -138,7 +138,7 @@ void Profile::AddDay(wxDateTime date,Day *day,MachineType mt) {
// Check for any other machines of same type.. Throw an exception if one already exists. // Check for any other machines of same type.. Throw an exception if one already exists.
vector<Day *> & dl=daylist[date]; vector<Day *> & dl=daylist[date];
for (auto a=dl.begin();a!=dl.end();a++) { for (vector<Day *>::iterator a=dl.begin();a!=dl.end();a++) {
if ((*a)->machine->GetType()==mt) { if ((*a)->machine->GetType()==mt) {
throw OneTypePerDay(); throw OneTypePerDay();
} }
@ -157,7 +157,7 @@ void Profile::Import(wxString path)
int c=0; int c=0;
wxLogMessage(wxT("Importing ")+path); wxLogMessage(wxT("Importing ")+path);
list<MachineLoader *>loaders=GetLoaders(); list<MachineLoader *>loaders=GetLoaders();
for (auto i=loaders.begin(); i!=loaders.end(); i++) { for (list<MachineLoader *>::iterator i=loaders.begin(); i!=loaders.end(); i++) {
c+=(*i)->Open(path,this); c+=(*i)->Open(path,this);
} }
} }
@ -194,7 +194,7 @@ void Done()
{ {
pref.Save(); pref.Save();
layout.Save(); layout.Save();
for (auto i=profiles.begin(); i!=profiles.end(); i++) { for (map<wxString,Profile *>::iterator i=profiles.begin(); i!=profiles.end(); i++) {
i->second->Save(); i->second->Save();
delete i->second; delete i->second;
} }
@ -268,7 +268,7 @@ void Scan()
Create(wxGetUserId(),wxGetUserName(),wxT("")); Create(wxGetUserId(),wxGetUserName(),wxT(""));
return; return;
} }
for (auto i=names.begin(); i!=names.end(); i++) { for (list<wxString>::iterator i=names.begin(); i!=names.end(); i++) {
wxString newpath=path+wxFileName::GetPathSeparator()+filename; wxString newpath=path+wxFileName::GetPathSeparator()+filename;
Profile *prof=new Profile(newpath); Profile *prof=new Profile(newpath);
prof->Open(); prof->Open();

View File

@ -49,7 +49,7 @@ PRS1Loader::PRS1Loader()
PRS1Loader::~PRS1Loader() PRS1Loader::~PRS1Loader()
{ {
for (auto i=PRS1List.begin(); i!=PRS1List.end(); i++) { for (map<wxString,Machine *>::iterator i=PRS1List.begin(); i!=PRS1List.end(); i++) {
delete i->second; delete i->second;
} }
delete [] m_buffer; delete [] m_buffer;
@ -64,7 +64,7 @@ Machine *PRS1Loader::CreateMachine(wxString serial,Profile *profile)
} }
vector<Machine *> ml=profile->GetMachines(MT_CPAP); vector<Machine *> ml=profile->GetMachines(MT_CPAP);
bool found=false; bool found=false;
for (auto i=ml.begin(); i!=ml.end(); i++) { for (vector<Machine *>::iterator i=ml.begin(); i!=ml.end(); i++) {
if (((*i)->GetClass()==wxT("PRS1")) && ((*i)->properties[wxT("Serial")]==serial)) { if (((*i)->GetClass()==wxT("PRS1")) && ((*i)->properties[wxT("Serial")]==serial)) {
PRS1List[serial]=*i; //static_cast<CPAP *>(*i); PRS1List[serial]=*i; //static_cast<CPAP *>(*i);
found=true; found=true;
@ -172,7 +172,7 @@ bool PRS1Loader::ParseProperties(Machine *m,wxString filename)
wxLogWarning(wxT("Serial Number in PRS1 properties.txt doesn't match directory structure")); wxLogWarning(wxT("Serial Number in PRS1 properties.txt doesn't match directory structure"));
} else prop.erase(wxT("SerialNumber")); // already got it stored. } else prop.erase(wxT("SerialNumber")); // already got it stored.
for (auto i=prop.begin(); i!=prop.end(); i++) { for (map<wxString,wxString>::iterator i=prop.begin(); i!=prop.end(); i++) {
m->properties[i->first]=i->second; m->properties[i->first]=i->second;
} }
@ -216,7 +216,7 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path,Profile *profile)
map<SessionID,StringList> sessfiles; map<SessionID,StringList> sessfiles;
int size=paths.size(); int size=paths.size();
int cnt=0; int cnt=0;
for (auto p=paths.begin(); p!=paths.end(); p++) { for (list<wxString>::iterator p=paths.begin(); p!=paths.end(); p++) {
dir.Open(*p); dir.Open(*p);
if (!dir.IsOpened()) continue;; if (!dir.IsOpened()) continue;;
bool cont=dir.GetFirst(&filename); bool cont=dir.GetFirst(&filename);
@ -250,7 +250,7 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path,Profile *profile)
size=sessfiles.size(); size=sessfiles.size();
cnt=0; cnt=0;
for (auto s=sessfiles.begin(); s!=sessfiles.end(); s++) { for (map<SessionID,StringList>::iterator s=sessfiles.begin(); s!=sessfiles.end(); s++) {
session=s->first; session=s->first;
cnt++; cnt++;
if (loader_progress) loader_progress->Update(25.0+(float(cnt)/float(size)*25.0)); if (loader_progress) loader_progress->Update(25.0+(float(cnt)/float(size)*25.0));

View File

@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type //Standard Version Type
static const long MAJOR = 0; static const long MAJOR = 0;
static const long MINOR = 7; static const long MINOR = 7;
static const long BUILD = 2761; static const long BUILD = 2786;
static const long REVISION = 9743; static const long REVISION = 9853;
//Miscellaneous Version Types //Miscellaneous Version Types
static const long BUILDS_COUNT = 8232; static const long BUILDS_COUNT = 8265;
#define RC_FILEVERSION 0,7,2761,9743 #define RC_FILEVERSION 0,7,2786,9853
#define RC_FILEVERSION_STRING "0, 7, 2761, 9743\0" #define RC_FILEVERSION_STRING "0, 7, 2786, 9853\0"
static const char FULLVERSION_STRING[] = "0.7.2761.9743"; static const char FULLVERSION_STRING[] = "0.7.2786.9853";
//These values are to keep track of your versioning state, don't modify them. //These values are to keep track of your versioning state, don't modify them.
static const long BUILD_HISTORY = 62; static const long BUILD_HISTORY = 62;