Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ltkcpp_error.cpp

00001 
00002 /*
00003  ***************************************************************************
00004  *  Copyright 2007,2008 Impinj, Inc.
00005  *
00006  *  Licensed under the Apache License, Version 2.0 (the "License");
00007  *  you may not use this file except in compliance with the License.
00008  *  You may obtain a copy of the License at
00009  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  *  Unless required by applicable law or agreed to in writing, software
00013  *  distributed under the License is distributed on an "AS IS" BASIS,
00014  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  *  See the License for the specific language governing permissions and
00016  *  limitations under the License.
00017  *
00018  ***************************************************************************
00019  */
00020 
00021 
00022 #include "ltkcpp_platform.h"
00023 #include "ltkcpp_base.h"
00024 
00025 
00026 namespace LLRP
00027 {
00028 
00029 CErrorDetails::CErrorDetails (void)
00030 {
00031     clear();
00032 }
00033 
00034 void
00035 CErrorDetails::clear (void)
00036 {
00037     memset(this, 0, sizeof *this);
00038 }
00039 
00040 void
00041 CErrorDetails::missingParameter (
00042   const CTypeDescriptor *       pRefType)
00043 {
00044     if(RC_OK == m_eResultCode)
00045     {
00046         clear();
00047         m_eResultCode = RC_MissingParameter;
00048         m_pWhatStr    = "missing parameter";
00049         m_pRefType    = pRefType;
00050     }
00051 }
00052 
00053 void
00054 CErrorDetails::unexpectedParameter (
00055   const CParameter *            pParameter)
00056 {
00057     if(RC_OK == m_eResultCode)
00058     {
00059         clear();
00060         m_eResultCode = RC_UnexpectedParameter;
00061         m_pWhatStr    = "unexpected parameter";
00062         m_pRefType    = pParameter->m_pType;
00063     }
00064 }
00065 
00066 void
00067 CErrorDetails::resultCodeAndWhatStr (
00068   EResultCode                   eResultCode,
00069   const char *                  pWhatStr)
00070 {
00071     if(RC_OK == m_eResultCode)
00072     {
00073         clear();
00074         m_eResultCode = eResultCode;
00075         m_pWhatStr    = pWhatStr;
00076     }
00077 }
00078 
00079 
00080 }; /* namespace LLRP */

Generated on Wed Nov 26 12:27:44 2008 for LTKCPP-- LLRP Toolkit C Plus Plus Library by  doxygen 1.3.9.1