Accelerator Independent Data Access / PVAccess 2.0
AIDA-PVA is the latest version of the AIDA framework. Built on top of EPICS 7 it enables client applications to programmatically access and manage any device or database on the SLAC Network using simple channel names.
Loading...
Searching...
No Matches
aida_pva_exceptions.h File Reference

The Header File for the exceptions helper MACROS. More...

#include "aida_pva.h"
#include "errtranslate.h"

Go to the source code of this file.

Macros

#define AIDA_INTERNAL_EXCEPTION   "AidaInternalException"
 Use this string to signal Internal Exceptions in aidaThrow() More...
 
#define MAX_ERROR_TEXT_LEN   100
 The maximum size of the error text message in an aidaThrow() call. More...
 
#define MISSING_REQUIRED_ARGUMENT_EXCEPTION   "MissingRequiredArgumentException"
 Use this string to signal Missing Required Argument Exceptions in aidaThrow() More...
 
#define ON_EXCEPTION_FREE_ARRAY_AND_PV_AND_ARGS_AND_RETURN_(_r)
 Check to see if an exception has been raised, free local variable Array, free local variable pv if set, free local variable Arguments and return the given return value. More...
 
#define ON_EXCEPTION_FREE_MEMORY_AND_RETURN_(_r)
 Check to see if an exception has been raised, then free tracked memory, and return the given return value. More...
 
#define ON_EXCEPTION_FREE_PV_AND_ARGUMENTS_AND_RETURN_(_r)
 Check to see if an exception has been raised, free local variable pv if set, free local variable Arguments and return the given return value. More...
 
#define ON_EXCEPTION_FREE_PV_AND_ARGUMENTS_AND_RETURN_VOID
 Check to see if an exception has been raised, free local variable pv if set, free local variable Arguments and return void,. More...
 
#define ON_EXCEPTION_FREE_STRING_AND_PV_AND_ARGS_AND_RETURN_(_r)
 Check to see if an exception has been raised, free a local variable string, free local variable pv if set, free local variable Arguments and return the given return value. More...
 
#define ON_EXCEPTION_FREE_STRING_AND_RETURN_(_r)
 Check to see if an exception has been raised, free a local variable string, and return the given return value. More...
 
#define ON_EXCEPTION_FREE_STRING_ARRAY_AND_PV_AND_ARGS_AND_RETURN_NULL
 Check to see if an exception has been raised, free local variable Array, free local variable pv if set, free local variable Arguments and return void. More...
 
#define ON_EXCEPTION_FREE_TABLE_AND_PV_AND_ARGS_AND_RETURN_(_r)
 Check to see if an exception has been raised, free local variable Table, free local variable pv if set, free local variable Arguments, and return the given return value. More...
 
#define ON_EXCEPTION_FREE_VALUE_AND_PV_AND_ARGS_AND_RETURN_(_r)
 Check to see if an exception has been raised, free local variable value, free local variable pv if set, free local variable Arguments, and return the given return value. More...
 
#define ON_EXCEPTION_FREE_VALUE_AND_PV_AND_ARGS_AND_RETURN_VOID
 Check to see if an exception has been raised, free local variable value, free local variable pv if set, free local variable Arguments and return void. More...
 
#define ON_EXCEPTION_RETURN_(_r)
 Check to see if an exception has been raised, and return the given return value. More...
 
#define ON_EXCEPTION_RETURN_VOID
 Check to see if an exception has been raised, and return void,. More...
 
#define PRINT_ERROR_FREE_MEMORY_AND_RETURN_(_exception, _errorText, _r)
 Throw error message in an exception, free any allocated memory and return the error code. More...
 
#define SERVER_INITIALISATION_EXCEPTION   "ServerInitialisationException"
 Use this string to signal Server Initialisation Exceptions in aidaThrow() More...
 
#define SPRINTF_ERROR_FREE_MEMORY_AND_RETURN_(_exception, _errorText, _ref, _r)
 Format an error message, throw it in an exception, free any allocated memory and return the error code. More...
 
#define SPRINTF_ERROR_STATUS_FREE_MEMORY_AND_RETURN_(_status, _exception, _errorText, _ref, _r)
 Format an error message, throw it in an exception, free any allocated memory and return the error code. More...
 
#define UNABLE_TO_GET_DATA_EXCEPTION   "UnableToGetDataException"
 Use this string to signal Exceptions when trying to Get Data in aidaThrow() More...
 
#define UNABLE_TO_SET_DATA_EXCEPTION   "UnableToSetDataException"
 Use this string to signal Exceptions when trying to Set Data in aidaThrow() More...
 
#define UNSUPPORTED_ARRAY_REQUEST
 Throw unsupported channel exception and return a blank array. More...
 
#define UNSUPPORTED_CHANNEL_EXCEPTION   "UnsupportedChannelException"
 Use this string to signal Unsupported Channel Exceptions in aidaThrow() More...
 
#define UNSUPPORTED_STRING_ARRAY_REQUEST
 Throw an unsupported channel exception and return an empty string array. More...
 
#define UNSUPPORTED_TABLE_REQUEST
 Throw an unsupported channel exception and return an empty table. More...
 

Detailed Description

The Header File for the exceptions helper MACROS.

CMS=C_INC

Definition in file aida_pva_exceptions.h.

Macro Definition Documentation

◆ AIDA_INTERNAL_EXCEPTION

#define AIDA_INTERNAL_EXCEPTION   "AidaInternalException"

Use this string to signal Internal Exceptions in aidaThrow()

Definition at line 18 of file aida_pva_exceptions.h.

◆ MAX_ERROR_TEXT_LEN

#define MAX_ERROR_TEXT_LEN   100

The maximum size of the error text message in an aidaThrow() call.

Definition at line 43 of file aida_pva_exceptions.h.

◆ MISSING_REQUIRED_ARGUMENT_EXCEPTION

#define MISSING_REQUIRED_ARGUMENT_EXCEPTION   "MissingRequiredArgumentException"

Use this string to signal Missing Required Argument Exceptions in aidaThrow()

Definition at line 38 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_ARRAY_AND_PV_AND_ARGS_AND_RETURN_

#define ON_EXCEPTION_FREE_ARRAY_AND_PV_AND_ARGS_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
releaseArray(array); \
releasePvAndArguments(env, uri, pv, arguments); \
return _r; \
}

Check to see if an exception has been raised, free local variable Array, free local variable pv if set, free local variable Arguments and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 168 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_MEMORY_AND_RETURN_

#define ON_EXCEPTION_FREE_MEMORY_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
FREE_MEMORY \
return _r; \
}

Check to see if an exception has been raised, then free tracked memory, and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 69 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_PV_AND_ARGUMENTS_AND_RETURN_

#define ON_EXCEPTION_FREE_PV_AND_ARGUMENTS_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
releasePvAndArguments(env, uri, pv, arguments); \
return _r; \
}

Check to see if an exception has been raised, free local variable pv if set, free local variable Arguments and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 99 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_PV_AND_ARGUMENTS_AND_RETURN_VOID

#define ON_EXCEPTION_FREE_PV_AND_ARGUMENTS_AND_RETURN_VOID
Value:
if ((*env)->ExceptionCheck(env)) { \
releasePvAndArguments(env, uri, pv, arguments); \
return; \
}

Check to see if an exception has been raised, free local variable pv if set, free local variable Arguments and return void,.

Uses local variable env for checking exception status.

Returns
This MACRO will return from your function if there has been an exception.

Definition at line 115 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_STRING_AND_PV_AND_ARGS_AND_RETURN_

#define ON_EXCEPTION_FREE_STRING_AND_PV_AND_ARGS_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
if ( string ) free(string); \
releasePvAndArguments(env, uri, pv, arguments); \
return _r; \
}

Check to see if an exception has been raised, free a local variable string, free local variable pv if set, free local variable Arguments and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 133 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_STRING_AND_RETURN_

#define ON_EXCEPTION_FREE_STRING_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
if ( string ) free(string); \
return _r; \
}

Check to see if an exception has been raised, free a local variable string, and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 150 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_STRING_ARRAY_AND_PV_AND_ARGS_AND_RETURN_NULL

#define ON_EXCEPTION_FREE_STRING_ARRAY_AND_PV_AND_ARGS_AND_RETURN_NULL
Value:
if ((*env)->ExceptionCheck(env)) { \
releaseStringArray(array); \
releasePvAndArguments(env, uri, pv, arguments); \
return NULL; \
}

Check to see if an exception has been raised, free local variable Array, free local variable pv if set, free local variable Arguments and return void.

Uses local variable env for checking exception status.

Returns
This MACRO will return from your function if there has been an exception.

Definition at line 186 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_TABLE_AND_PV_AND_ARGS_AND_RETURN_

#define ON_EXCEPTION_FREE_TABLE_AND_PV_AND_ARGS_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
releaseTable(table); \
releasePvAndArguments(env, uri, pv, arguments); \
return _r; \
}

Check to see if an exception has been raised, free local variable Table, free local variable pv if set, free local variable Arguments, and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 205 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_VALUE_AND_PV_AND_ARGS_AND_RETURN_

#define ON_EXCEPTION_FREE_VALUE_AND_PV_AND_ARGS_AND_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
releaseValue(value); \
releasePvAndArguments(env, uri, pv, arguments); \
return _r; \
}

Check to see if an exception has been raised, free local variable value, free local variable pv if set, free local variable Arguments, and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 242 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_FREE_VALUE_AND_PV_AND_ARGS_AND_RETURN_VOID

#define ON_EXCEPTION_FREE_VALUE_AND_PV_AND_ARGS_AND_RETURN_VOID
Value:
if ((*env)->ExceptionCheck(env)) { \
releaseValue(value); \
releasePvAndArguments(env, uri, pv, arguments); \
return; \
}

Check to see if an exception has been raised, free local variable value, free local variable pv if set, free local variable Arguments and return void.

Uses local variable env for checking exception status.

Returns
This MACRO will return from your function if there has been an exception.

Definition at line 223 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_RETURN_

#define ON_EXCEPTION_RETURN_ (   _r)
Value:
if ((*env)->ExceptionCheck(env)) { \
return _r; \
}

Check to see if an exception has been raised, and return the given return value.

Uses local variable env for checking exception status.

Parameters
_rthe specified return value.
Returns
This MACRO will return the specified return value from your function if there has been an exception.

Definition at line 54 of file aida_pva_exceptions.h.

◆ ON_EXCEPTION_RETURN_VOID

#define ON_EXCEPTION_RETURN_VOID
Value:
if ((*env)->ExceptionCheck(env)) { \
return; \
}

Check to see if an exception has been raised, and return void,.

Uses local variable env for checking exception status.

Returns
This MACRO will return from your function if there has been an exception.

Definition at line 83 of file aida_pva_exceptions.h.

◆ PRINT_ERROR_FREE_MEMORY_AND_RETURN_

#define PRINT_ERROR_FREE_MEMORY_AND_RETURN_ (   _exception,
  _errorText,
  _r 
)
Value:
{ \
aidaThrowNonOsException(env, _exception, _errorText); \
FREE_MEMORY \
return _r; \
}

Throw error message in an exception, free any allocated memory and return the error code.

Parameters
_exceptionexception to raise (string)
_errorTextthe text of the error to raise
_rthe specified return value
Returns
This MACRO will return the specified return value from your function

Definition at line 294 of file aida_pva_exceptions.h.

◆ SERVER_INITIALISATION_EXCEPTION

#define SERVER_INITIALISATION_EXCEPTION   "ServerInitialisationException"

Use this string to signal Server Initialisation Exceptions in aidaThrow()

Definition at line 22 of file aida_pva_exceptions.h.

◆ SPRINTF_ERROR_FREE_MEMORY_AND_RETURN_

#define SPRINTF_ERROR_FREE_MEMORY_AND_RETURN_ (   _exception,
  _errorText,
  _ref,
  _r 
)
Value:
{ \
char error[MAX_ERROR_TEXT_LEN + strlen(_ref)]; \
sprintf(error, _errorText, _ref); \
aidaThrowNonOsException(env, _exception, error); \
FREE_MEMORY \
return _r; \
}
#define MAX_ERROR_TEXT_LEN
The maximum size of the error text message in an aidaThrow() call.

Format an error message, throw it in an exception, free any allocated memory and return the error code.

Parameters
_exceptionexception to raise (string)
_errorTextthe text of the error to raise
_refa string that will be substituted in message with s
_rthe specified return value
Returns
This MACRO will return the specified return value from your function

Definition at line 258 of file aida_pva_exceptions.h.

◆ SPRINTF_ERROR_STATUS_FREE_MEMORY_AND_RETURN_

#define SPRINTF_ERROR_STATUS_FREE_MEMORY_AND_RETURN_ (   _status,
  _exception,
  _errorText,
  _ref,
  _r 
)
Value:
{ \
char error[MAX_ERROR_TEXT_LEN + strlen(_ref)]; \
sprintf(error, _errorText, _ref); \
aidaThrow(env, _status, _exception, error); \
FREE_MEMORY \
return _r; \
}

Format an error message, throw it in an exception, free any allocated memory and return the error code.

Parameters
_exceptionexception to raise (string)
_statusthe OS status code to include in the message
_errorTextthe text of the error to raise
_refa string that will be substituted in message with s
_rthe specified return value
Returns
This MACRO will return the specified return value from your function

Definition at line 277 of file aida_pva_exceptions.h.

◆ UNABLE_TO_GET_DATA_EXCEPTION

#define UNABLE_TO_GET_DATA_EXCEPTION   "UnableToGetDataException"

Use this string to signal Exceptions when trying to Get Data in aidaThrow()

Definition at line 26 of file aida_pva_exceptions.h.

◆ UNABLE_TO_SET_DATA_EXCEPTION

#define UNABLE_TO_SET_DATA_EXCEPTION   "UnableToSetDataException"

Use this string to signal Exceptions when trying to Set Data in aidaThrow()

Definition at line 30 of file aida_pva_exceptions.h.

◆ UNSUPPORTED_ARRAY_REQUEST

#define UNSUPPORTED_ARRAY_REQUEST
Value:
Array array; \
return array;
#define UNSUPPORTED_CHANNEL_EXCEPTION
Use this string to signal Unsupported Channel Exceptions in aidaThrow()
void aidaThrowNonOsException(JNIEnv *env, char *exception, const char *message)
To log any non-OS exceptions and throw back to java.
An array of data.

Throw unsupported channel exception and return a blank array.

Definition at line 304 of file aida_pva_exceptions.h.

◆ UNSUPPORTED_CHANNEL_EXCEPTION

#define UNSUPPORTED_CHANNEL_EXCEPTION   "UnsupportedChannelException"

Use this string to signal Unsupported Channel Exceptions in aidaThrow()

Definition at line 34 of file aida_pva_exceptions.h.

◆ UNSUPPORTED_STRING_ARRAY_REQUEST

#define UNSUPPORTED_STRING_ARRAY_REQUEST
Value:
StringArray stringArray; \
return stringArray;
An array of string data.

Throw an unsupported channel exception and return an empty string array.

Definition at line 312 of file aida_pva_exceptions.h.

◆ UNSUPPORTED_TABLE_REQUEST

#define UNSUPPORTED_TABLE_REQUEST
Value:
Table table; \
return table;
Table structure.

Throw an unsupported channel exception and return an empty table.

Definition at line 320 of file aida_pva_exceptions.h.