1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include "stdafx.h"
- #include "OTSSampleClr.h"
- #include <COTSUtilityDllFunExport.h>
- 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;
- }
- }
|