30 #ifndef GENAPI_EXCEPTION_H 31 #define GENAPI_EXCEPTION_H 70 ValueStr =
"GetAccessMode";
72 ValueStr =
"ToString";
74 ValueStr =
"FromString";
76 ValueStr =
"GetValue";
78 ValueStr =
"SetValue";
90 ValueStr =
"SetIntValue";
92 ValueStr =
"GetIntValue";
93 else if( *pValue ==
meSet )
95 else if( *pValue ==
meGet )
98 ValueStr =
"_UndefinedMethod";
118 , m_pNodePrivate( pNodePrivate )
119 , m_ExceptionType( pExceptionType )
128 va_start( vap, pFormat );
130 #if defined (_MSC_VER) 131 vsnprintf_s( pBuffer,
sizeof pBuffer, _TRUNCATE, pFormat, vap );
133 vsnprintf( pBuffer,
sizeof pBuffer, pFormat, vap );
139 m_pNodePrivate->GetName().
c_str(),
140 m_ExceptionType.c_str()
154 # define GENERIC_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::GenericException>(__FILE__, __LINE__, this, "GenericException" ).Report 157 # define INVALID_ARGUMENT_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::InvalidArgumentException>(__FILE__, __LINE__, this, "InvalidArgumentException" ).Report 160 # define OUT_OF_RANGE_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::OutOfRangeException>(__FILE__, __LINE__, this, "OutOfRangeException" ).Report 163 # define PROPERTY_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::PropertyException>(__FILE__, __LINE__, this, "PropertyException" ).Report 166 # define RUNTIME_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::RuntimeException>(__FILE__, __LINE__, this, "RuntimeException" ).Report 169 # define LOGICAL_ERROR_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::LogicalErrorException>(__FILE__, __LINE__, this, "LogicalErrorException" ).Report 172 # define ACCESS_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::AccessException>(__FILE__, __LINE__, this, "AccessException" ).Report 175 # define TIMEOUT_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::TimeoutException>(__FILE__, __LINE__, this, "TimeoutException" ).Report 178 # define DYNAMICCAST_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::DynamicCastException>(__FILE__, __LINE__, this, "DynamicCastException" ).Report 181 # define CHECK_RANGE_I64_NODE(_Value, _Min, _Max, _Inc) \ 182 if((int64_t)(_Value) < (int64_t)(_Min)) \ 183 throw OUT_OF_RANGE_EXCEPTION_NODE("Value = %" FMT_I64 "d must be equal or greater than Min = %" FMT_I64 "d.", (int64_t)(_Value), (int64_t)(_Min)); \ 184 else if((int64_t)(_Value) > (int64_t)(_Max)) \ 185 throw OUT_OF_RANGE_EXCEPTION_NODE("Value = %" FMT_I64 "d must be equal or smaller than Max = %" FMT_I64 "d.", (int64_t)(_Value), (int64_t)(_Max)); \ 186 else if ( 0 >= _Inc ) \ 187 throw LOGICAL_ERROR_EXCEPTION_NODE("Increment must be larger than 0."); \ 188 else if( ((int64_t)(_Value) - (int64_t)(_Min)) % (int64_t)(_Inc) != 0) \ 189 throw OUT_OF_RANGE_EXCEPTION_NODE("The difference between Value = %" FMT_I64 "d and Min = %" FMT_I64 "d must be dividable without rest by Inc = %" FMT_I64 "d.", (int64_t)(_Value), (int64_t)(_Min), (int64_t)(_Inc)); 192 # define CHECK_RANGE_FLT_NODE(_Value, _Min, _Max) \ 193 if ((_Value) < (_Min)) \ 194 throw OUT_OF_RANGE_EXCEPTION_NODE( "Value %f must be greater than or equal %f.", (_Value), (_Min) ); \ 195 else if ((_Value) > (_Max)) \ 196 throw OUT_OF_RANGE_EXCEPTION_NODE( "Value %f must be smaller than or equal %f.", (_Value), (_Max) ); 201 #endif // GENAPI_EXCEPTION_H
printf like creation of exceptions
GENICAM_INTERFACE INodePrivate
Interface including the methods for node construction common to all nodes.
GENICAM_INTERFACE INodeMap
Interface to access the node map.
GENICAM_NAMESPACE::gcstring m_ExceptionType
The full error message.
ExceptionReporterNode(const char *sourceFileName, unsigned int sourceLine, const INodePrivate *pNodePrivate, const char *pExceptionType)
GENICAM_NAMESPACE::gcstring getEntryPoint(INodeMap *nodeMap)
static GENICAM_NAMESPACE::gcstring ToString(EMethod Value)
Converts a string to an int32_t property.
const INodePrivate * m_pNodePrivate
EMethod
denotes through which method call the node tree was entered
A string class which is a clone of std::string.
static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EMethod *pValue)
Converts a string to an int32_t property.
virtual const char * c_str(void) const
E Report(const char *pFormat,...)
Lexical analyzer for CIntSwissKnife.
Definition of interface INodePrivate.