Go to the documentation of this file.
30 #ifndef GENAPI_EXCEPTION_H
31 #define GENAPI_EXCEPTION_H
71 ValueStr =
"GetAccessMode";
73 ValueStr =
"ToString";
75 ValueStr =
"FromString";
77 ValueStr =
"GetValue";
79 ValueStr =
"SetValue";
91 ValueStr =
"SetIntValue";
93 ValueStr =
"GetIntValue";
94 else if( *pValue ==
meSet )
96 else if( *pValue ==
meGet )
99 ValueStr =
"GetIncMode";
101 ValueStr =
"GetListOfValidValues";
103 ValueStr =
"InvalidateNode";
105 ValueStr =
"_UndefinedMethod";
135 va_start( vap, pFormat );
137 #if defined (_MSC_VER)
138 vsnprintf_s( pBuffer,
sizeof pBuffer, _TRUNCATE, pFormat, vap );
140 vsnprintf( pBuffer,
sizeof pBuffer, pFormat, vap );
161 # define GENERIC_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::GenericException>(__FILE__, __LINE__, this, "GenericException" ).Report
164 # define INVALID_ARGUMENT_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::InvalidArgumentException>(__FILE__, __LINE__, this, "InvalidArgumentException" ).Report
167 # define OUT_OF_RANGE_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::OutOfRangeException>(__FILE__, __LINE__, this, "OutOfRangeException" ).Report
170 # define PROPERTY_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::PropertyException>(__FILE__, __LINE__, this, "PropertyException" ).Report
173 # define RUNTIME_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::RuntimeException>(__FILE__, __LINE__, this, "RuntimeException" ).Report
176 # define LOGICAL_ERROR_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::LogicalErrorException>(__FILE__, __LINE__, this, "LogicalErrorException" ).Report
179 # define ACCESS_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::AccessException>(__FILE__, __LINE__, this, "AccessException" ).Report
182 # define TIMEOUT_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::TimeoutException>(__FILE__, __LINE__, this, "TimeoutException" ).Report
185 # define DYNAMICCAST_EXCEPTION_NODE GENAPI_NAMESPACE::ExceptionReporterNode<GENICAM_NAMESPACE::DynamicCastException>(__FILE__, __LINE__, this, "DynamicCastException" ).Report
188 # define CHECK_RANGE_I64_NODE(_Value, _Min, _Max, _Inc) \
189 if((int64_t)(_Value) < (int64_t)(_Min)) \
190 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)); \
191 else if((int64_t)(_Value) > (int64_t)(_Max)) \
192 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)); \
193 else if ( 0 >= _Inc ) \
194 throw LOGICAL_ERROR_EXCEPTION_NODE("Increment must be larger than 0."); \
195 else if( ((int64_t)(_Value) - (int64_t)(_Min)) % (int64_t)(_Inc) != 0) \
196 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));
199 # define CHECK_RANGE_FLT_NODE(_Value, _Min, _Max) \
200 if ((_Value) < (_Min)) \
201 throw OUT_OF_RANGE_EXCEPTION_NODE( "Value %f must be greater than or equal %f.", (_Value), (_Min) ); \
202 else if ((_Value) > (_Max)) \
203 throw OUT_OF_RANGE_EXCEPTION_NODE( "Value %f must be smaller than or equal %f.", (_Value), (_Max) );
207 #endif // GENAPI_EXCEPTION_H
Lexical analyzer for CIntSwissKnife.
ExceptionReporter(const char *pSourceFileName, int SourceLine)
ExceptionReporterNode(const char *sourceFileName, unsigned int sourceLine, const INodePrivate *pNodePrivate, const char *pExceptionType)
printf like creation of exceptions
E Report(const char *pFormat,...)
A string class which is a clone of std::string.
GENICAM_NAMESPACE::gcstring m_ExceptionType
The full error message.
const INodePrivate * m_pNodePrivate
GENICAM_NAMESPACE::gcstring getEntryPoint(INodeMap *nodeMap)
GENICAM_INTERFACE INodeMap
Interface to access the node map.
EMethod
denotes through which method call the node tree was entered
Definition of interface INodePrivate.
GENICAM_INTERFACE INodePrivate
Interface including the methods for node construction common to all nodes.
static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EMethod *pValue)
Converts a string to an int32_t property.
virtual const char * c_str(void) const
static GENICAM_NAMESPACE::gcstring ToString(EMethod Value)
Converts a string to an int32_t property.
rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11