| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 | #include "stdafx.h"#include "OTSPeak.h"// CIntRangenamespace 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;	}}
 |