#include "stdafx.h" #include "OTSSampleClr.h" #include namespace OTSCLRINTERFACE { //using namespace Newtonsoft::Json ::Linq; COTSSampleClr::COTSSampleClr() { theSample = new COTSSamplePtr(new COTSSample()); } COTSSampleClr::COTSSampleClr(COTSSamplePtr pSample) // copy constructor { ASSERT(pSample); //theSample= new COTSSamplePtr(new COTSSample(pSample.get())); theSample = new COTSSamplePtr(pSample); //*theSample = pSample; } COTSSampleClr::~COTSSampleClr() { if (theSample != nullptr) { delete theSample; theSample = nullptr; } } COTSSampleClr::!COTSSampleClr() { if (theSample != nullptr) { delete theSample; theSample = nullptr; } } COTSSamplePtr COTSSampleClr::GetSamplePtr() { return *theSample; } // has measure results test bool COTSSampleClr::HasMeasureResult() { COTSSamplePtr pSample = GetSamplePtr(); if (pSample == nullptr) { LogErrorTrace(__FILE__, __LINE__, _T("HasMeasureResult: invalide pointer.")); return false; } return pSample->HasMeasureResult(); } bool COTSSampleClr::GetBSESize(int% a_nWidth, int% a_nHeight) { COTSSamplePtr pSample = GetSamplePtr(); if (pSample == nullptr) { LogErrorTrace(__FILE__, __LINE__, _T("GetBSESize: invalide pointer.")); return false; } int nWidth = 0; int nHeight = 0; bool bRet = pSample->GetBSESize(nWidth, nHeight); a_nWidth = nWidth; a_nHeight = nHeight; return bRet; } }