#include "stdafx.h" #include "OTSPeak.h" // CIntRange namespace OTSDATA { // constructor COTSPeak::COTSPeak() { // initialization Init(); } // copy constructor COTSPeak::COTSPeak(const COTSPeak& a_oSource) { // can't copy itself if (&a_oSource == this) { return; } // copy data over Duplicate(a_oSource); } // copy constructor COTSPeak::COTSPeak(COTSPeak* a_poSource) { // input check ASSERT(a_poSource); if (!a_poSource) { return; } // can't copy itself if (a_poSource == this) { return; } // copy data over Duplicate(*a_poSource); } // =operator COTSPeak& COTSPeak::operator=(const COTSPeak& a_oSource) { // cleanup Cleanup(); // copy the class data over Duplicate(a_oSource); // return class return *this; } // ==operator BOOL COTSPeak::operator==(const COTSPeak& a_oSource) { // return test result return m_nPosition == a_oSource.m_nPosition && m_nHeight == a_oSource.m_nHeight && m_oRange == a_oSource.m_oRange; } // detractor COTSPeak::~COTSPeak() { Cleanup(); } // COTSPeak member functions // public // serialization //void COTSPeak::Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode) //{ // xmls::xLong xnPosition; // xmls::xLong xnHeight; // xmls::Slo slo; // slo.Register("Position", &xnPosition); // slo.Register("Height", &xnHeight); //// this->Register("Range", m_oRange.getClassName()); // // if (isStoring) // { // xnPosition = m_nPosition; // xnHeight = m_nHeight; // // slo.Serialize(true, classDoc, rootNode); // } // else // { // slo.Serialize(false, classDoc, rootNode); // m_nPosition = xnPosition.value(); // m_nHeight = xnHeight.value(); // } //} // protected // cleanup void COTSPeak::Cleanup() { // nothing needs to be done at the moment } // initialization void COTSPeak::Init() { m_nPosition = 0; m_nHeight = 0; m_oRange = CIntRange(); } // duplication void COTSPeak::Duplicate(const COTSPeak& a_oSource) { // initialization Init(); // copy data over m_nPosition = a_oSource.m_nPosition; m_nHeight = a_oSource.m_nHeight; m_oRange = a_oSource.m_oRange; } }