LTKCPP-- LLRP Toolkit C Plus Plus Library
ltkcpp_error.cpp
1 
2 /*
3  *****************************************************************************
4  * *
5  * IMPINJ CONFIDENTIAL AND PROPRIETARY *
6  * *
7  * This source code is the sole property of Impinj, Inc. Reproduction or *
8  * utilization of this source code in whole or in part is forbidden without *
9  * the prior written consent of Impinj, Inc. *
10  * *
11  * (c) Copyright Impinj, Inc. 2007,2008. All rights reserved. *
12  * *
13  *****************************************************************************/
14 
15 
16 #include "ltkcpp_platform.h"
17 #include "ltkcpp_base.h"
18 
19 
20 namespace LLRP
21 {
22 
24 {
25  clear();
26 }
27 
28 void
30 {
31  memset(this, 0, sizeof *this);
32 }
33 
34 void
36  const CTypeDescriptor * pRefType)
37 {
38  if(RC_OK == m_eResultCode)
39  {
40  clear();
42  m_pWhatStr = "missing parameter";
43  m_pRefType = pRefType;
44  }
45 }
46 
47 void
49  const CParameter * pParameter)
50 {
51  if(RC_OK == m_eResultCode)
52  {
53  clear();
55  m_pWhatStr = "unexpected parameter";
56  m_pRefType = pParameter->m_pType;
57  }
58 }
59 
60 void
62  EResultCode eResultCode,
63  const char * pWhatStr)
64 {
65  if(RC_OK == m_eResultCode)
66  {
67  clear();
68  m_eResultCode = eResultCode;
69  m_pWhatStr = pWhatStr;
70  }
71 }
72 
73 
74 }; /* namespace LLRP */
const CTypeDescriptor * m_pType
The type descriptor desribing this element.
Definition: ltkcpp_base.h:972
void unexpectedParameter(const CParameter *pParameter)
Convenience function used by the toolkit to set CErrorDetails when it encounters an unexpected parame...
const CTypeDescriptor * m_pRefType
If non-NULL this is the type descriptors for the errored type.
Definition: ltkcpp_base.h:639
EResultCode m_eResultCode
Result code from operation.
Definition: ltkcpp_base.h:635
Based type descriptions for the LTKCPP library.
const char * m_pWhatStr
Descriptive printable error string.
Definition: ltkcpp_base.h:637
EResultCode
Error result codes for LTK operations.
Definition: ltkcpp_base.h:583
Based types for the LKTCPP library.
CErrorDetails(void)
Default Constructor.
void resultCodeAndWhatStr(EResultCode eResultCode, const char *pWhatStr)
Convenience function used by the toolkit to set CErrorDetails result code and pWhatStr.
void clear(void)
Clears the contents of a CErrorDetails.
void missingParameter(const CTypeDescriptor *pRefType)
Convenience function used by the toolkit to set CErrorDetails when it encounters an missing parameter...
Base Class for All LLRP LTK Parameters.
Definition: ltkcpp_base.h:1125
Describes a message or parameter type.
Definition: ltkcpp_base.h:755