#include #include DiveProfile::DiveProfile(void) { } DiveProfile::DiveProfile(const DiveProfile &diveProfile) { *this=diveProfile; } DiveProfile::~DiveProfile() { } DiveProfile &DiveProfile::operator=(const DiveProfile &diveProfile) { remove(); for(int index=0;index&)diveProfile)[index]; insert(&ProfileData(profileData.getDepth(),profileData.getStageTime(),profileData.getWarning())); } return *this; } bool DiveProfile::operator==(const DiveProfile &diveProfile)const { if(size()!=diveProfile.size())return false; for(int index=0;index&)diveProfile)[index]; ProfileData &profileDataDst=((Block&)*this)[index]; if(!(profileDataSrc==profileDataDst))return false; } return true; } bool DiveProfile::readFrom(File &inFile) { int count; if(!inFile.isOkay())return false; if(!inFile.read(&count,sizeof(count)))return false; for(int index=0;index&)*this).operator[](index).getDepth()>maxDepth)maxDepth=((Block&)*this).operator[](index).getDepth(); } return maxDepth; } int DiveProfile::getBottomTime(void)const { return ((Block&)*this).operator[](size()-1).getStageTime()/60; }