LTKCPP-- LLRP Toolkit C Plus Plus Library
|
00001 00002 /* 00003 ***************************************************************************** 00004 * * 00005 * IMPINJ CONFIDENTIAL AND PROPRIETARY * 00006 * * 00007 * This source code is the sole property of Impinj, Inc. Reproduction or * 00008 * utilization of this source code in whole or in part is forbidden without * 00009 * the prior written consent of Impinj, Inc. * 00010 * * 00011 * (c) Copyright Impinj, Inc. 2007,2008. All rights reserved. * 00012 * * 00013 *****************************************************************************/ 00014 00015 00016 #include "ltkcpp_platform.h" 00017 #include "ltkcpp_base.h" 00018 00019 00020 namespace LLRP 00021 { 00022 00023 CErrorDetails::CErrorDetails (void) 00024 { 00025 clear(); 00026 } 00027 00028 void 00029 CErrorDetails::clear (void) 00030 { 00031 memset(this, 0, sizeof *this); 00032 } 00033 00034 void 00035 CErrorDetails::missingParameter ( 00036 const CTypeDescriptor * pRefType) 00037 { 00038 if(RC_OK == m_eResultCode) 00039 { 00040 clear(); 00041 m_eResultCode = RC_MissingParameter; 00042 m_pWhatStr = "missing parameter"; 00043 m_pRefType = pRefType; 00044 } 00045 } 00046 00047 void 00048 CErrorDetails::unexpectedParameter ( 00049 const CParameter * pParameter) 00050 { 00051 if(RC_OK == m_eResultCode) 00052 { 00053 clear(); 00054 m_eResultCode = RC_UnexpectedParameter; 00055 m_pWhatStr = "unexpected parameter"; 00056 m_pRefType = pParameter->m_pType; 00057 } 00058 } 00059 00060 void 00061 CErrorDetails::resultCodeAndWhatStr ( 00062 EResultCode eResultCode, 00063 const char * pWhatStr) 00064 { 00065 if(RC_OK == m_eResultCode) 00066 { 00067 clear(); 00068 m_eResultCode = eResultCode; 00069 m_pWhatStr = pWhatStr; 00070 } 00071 } 00072 00073 00074 }; /* namespace LLRP */