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.
|
The Header File for the AIDA-PVA Module functions. More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stsdef.h>
#include <stdbool.h>
#include <jni.h>
#include "slc_macros.h"
#include "msg_proto.h"
#include "errtranslate.h"
#include "ref.h"
#include "process_parm.h"
#include "aida_pva_json.h"
#include "aida_pva_types.h"
#include "aida_pva_exceptions.h"
#include "aida_pva_api.h"
#include "aida_pva_convert.h"
#include "aida_pva_memory.h"
#include "aida_pva_uri.h"
Go to the source code of this file.
Functions | |
void | aidaThrow (JNIEnv *env, vmsstat_t status, char *exception, const char *message) |
Exception Handling. More... | |
void | aidaThrowNonOsException (JNIEnv *env, char *exception, const char *message) |
To log any non-OS exceptions and throw back to java. More... | |
void * | allocateMemory (JNIEnv *env, void *source, size_t size, bool nullTerminate, char *message) |
Memory Handling. More... | |
int | ascanf (JNIEnv *env, Arguments *arguments, const char *formatString,...) |
Argument Processing. More... | |
int | avscanf (JNIEnv *env, Arguments *arguments, Value *value, const char *formatString,...) |
ascanf(), avscanf() More... | |
int | endsWith (const char *str, char *suffix) |
String Handling. More... | |
int | groupNameFromUri (char groupName[], const char *uri) |
URI Handling for group, secn, pmu and slacName. More... | |
vmsstat_t | init (const char *processName, bool initMessageServices) |
Initialisation. More... | |
int | pmuFromDeviceName (JNIEnv *env, char *device, char *primary, char *micro, int4u *unit) |
Get primary, micro and unit from a device name. More... | |
void | pmuStringFromUri (char *pmuString, const char *uri) |
Get the pmu part of a URI. More... | |
void | releaseArray (Array array) |
Free up any memory allocated the given scalar array. More... | |
void | releasePvAndArguments (JNIEnv *env, jstring uri, const char *pv, Arguments arguments) |
Free up any memory allocated for the given pv and arguments. More... | |
void | releaseStringArray (StringArray array) |
Free up any memory allocated for string arrays. More... | |
void | releaseTable (Table table) |
Free up any memory allocated for the given table. More... | |
void | releaseValue (Value value) |
Release all allocated memory in the given value. More... | |
void | secnFromUri (const char *uri, int4u *secn) |
Get secondary from pseudo secondary (containing a colon) number from URI. More... | |
const char * | secondaryFromUri (const char *uri) |
Get secondary from URI. More... | |
int | startsWith (const char *str, char *prefix) |
Check if a string starts with another string. More... | |
void | tableAddColumn (JNIEnv *env, Table *table, Type type, void *data, bool ieeeFormat) |
Add a column of arbitrary type to a Table. More... | |
void | tableAddField (JNIEnv *env, Table *table, char *fieldName) |
Add a dynamic field to a table. More... | |
void | tableAddFixedWidthStringColumn (JNIEnv *env, Table *table, char *data, int width) |
Add fixed-width string data to a column in the given Table. More... | |
void | tableAddLabel (JNIEnv *env, Table *table, char *labelName) |
Add a dynamic column to a table. More... | |
void | tableAddSingleRowBooleanColumn (JNIEnv *env, Table *table, unsigned char data) |
Add a boolean column to a Table with only one row. More... | |
void | tableAddSingleRowByteColumn (JNIEnv *env, Table *table, unsigned char data) |
Add a byte column to a Table with only one row. More... | |
void | tableAddSingleRowDoubleColumn (JNIEnv *env, Table *table, double data, bool ieeeDouble) |
Add a double column to a Table with only one row. More... | |
void | tableAddSingleRowFloatColumn (JNIEnv *env, Table *table, float data, bool ieeeFloat) |
Add a float column to a Table with only one row. More... | |
void | tableAddSingleRowIntegerColumn (JNIEnv *env, Table *table, int data) |
Add a integer column to a Table with only one row. More... | |
void | tableAddSingleRowLongColumn (JNIEnv *env, Table *table, long data) |
Add a long column to a Table with only one row. More... | |
void | tableAddSingleRowShortColumn (JNIEnv *env, Table *table, short data) |
Add a short column to a Table with only one row. More... | |
void | tableAddSingleRowStringColumn (JNIEnv *env, Table *table, char *data) |
Add a string column to a Table with only one row. More... | |
void | tableAddStringColumn (JNIEnv *env, Table *table, char **data) |
Add a String column to the given Table. More... | |
Table | tableCreate (JNIEnv *env, int rows, int columns) |
Table Handling. More... | |
Table | tableCreateDynamic (JNIEnv *env, int rows, int columns) |
Make a Dynamic Table for return to client. More... | |
void | uriLegacyName (char legacyName[MAX_URI_LEN], const char *uri) |
Convert the given URI to the legacy AIDA name for low level functions that still require it that way. More... | |
void | uriToSlcName (char slcName[MAX_URI_LEN], const char *uri) |
Convert all URIs to slac names before making queries. More... | |
void aidaThrow | ( | JNIEnv * | env, |
vmsstat_t | status, | ||
char * | exception, | ||
const char * | message | ||
) |
Exception Handling.
To log any exceptions and throw back to java.
The #exception is formatted in a standard way using the VMS status code and its associated message and the optionally supplied #message. The #exception is always assumed to be from the edu.stanford.slac.except package
env | the JNI environment. Used in all functions involving JNI |
status | the VMS status code to luck up and display text for. |
exception | the string representation of the exception class to throw. |
message | the optional message to attach to the exception. If NULL it is ignored. |
Exception Handling.
The #exception is formatted in a standard way using the VMS status code and its associated message and the optionally supplied #message. The #exception is always assumed to be from the edu.stanford.slac.except package
env | the JNI environment. Used in all functions involving JNI |
status | the VMS status code to luck up and display text for. |
exception | the string representation of the exception class to throw. |
message | the optional message to attach to the exception. If NULL it is ignored. |
Definition at line 92 of file aida_pva_server_helper.c.
Referenced by aidaRequestBoolean(), aidaRequestBooleanArray(), aidaRequestByte(), aidaRequestByteArray(), aidaRequestDouble(), aidaRequestDoubleArray(), aidaRequestFloat(), aidaRequestFloatArray(), aidaRequestInteger(), aidaRequestIntegerArray(), aidaRequestLong(), aidaRequestLongArray(), aidaRequestShort(), aidaRequestShortArray(), aidaRequestString(), aidaRequestTable(), aidaServiceInit(), aidaSetValue(), aidaSetValueWithResponse(), and aidaThrowNonOsException().
void aidaThrowNonOsException | ( | JNIEnv * | env, |
char * | exception, | ||
const char * | message | ||
) |
To log any non-OS exceptions and throw back to java.
The #exception is formatted in a standard way with the optionally supplied #message. The #exception is always assumed to be from the edu.stanford.slac.except package
env | the JNI environment. Used in all functions involving JNI |
exception | the string representation of the exception class to throw. |
message | the optional message to attach to the exception. If NULL it is ignored. |
Definition at line 75 of file aida_pva_server_helper.c.
References aidaThrow().
Referenced by aidaRequestBoolean(), aidaRequestBooleanArray(), aidaRequestByte(), aidaRequestByteArray(), aidaRequestDouble(), aidaRequestDoubleArray(), aidaRequestFloat(), aidaRequestFloatArray(), aidaRequestInteger(), aidaRequestIntegerArray(), aidaRequestLong(), aidaRequestLongArray(), aidaRequestShort(), aidaRequestShortArray(), aidaRequestString(), aidaRequestStringArray(), aidaRequestTable(), aidaSetValue(), aidaSetValueWithResponse(), allocateMemory(), getClassAndValueOfMethod(), newObject(), newObjectFromClass(), pmuFromDeviceName(), tableAddColumn(), tableAddField(), tableAddLabel(), tableCreate(), toBoolean(), toBooleanArray(), toByte(), toByteArray(), toDouble(), toDoubleArray(), toFloat(), toFloatArray(), toInteger(), toIntegerArray(), toLong(), toLongArray(), toShort(), toShortArray(), toStringArray(), and toTable().
void * allocateMemory | ( | JNIEnv * | env, |
void * | source, | ||
size_t | size, | ||
bool | nullTerminate, | ||
char * | message | ||
) |
Memory Handling.
Allocate memory and copy the source to it if specified. If the null terminate flag is set null terminate the allocate space, at the last position
env | to be used to throw exceptions using aidaThrow() and aidaThrowNonOsException() |
source | source of data to copy to newly allocated space, NULL to not copy |
size | the amount of space to allocate |
nullTerminate | true to null terminate |
message | the message to display if anything goes wrong |
Memory Handling.
If the null terminate flag is set null terminate the allocate space, at the last position
env | to be used to throw exceptions using aidaThrow() and aidaThrowNonOsException() |
source | source of data to copy to newly allocated space, NULL to not copy |
size | the amount of space to allocate |
nullTerminate | true to null terminate |
message | the message to display if anything goes wrong |
Definition at line 629 of file aida_pva_server_helper.c.
References AIDA_INTERNAL_EXCEPTION, and aidaThrowNonOsException().
int ascanf | ( | JNIEnv * | env, |
Arguments * | arguments, | ||
const char * | formatString, | ||
... | |||
) |
Argument Processing.
Reads data from the given arguments
and stores them according to parameter format into the locations given by the additional arguments, as if scanf() was used, but reading from arguments instead of the standard input (stdin).
env | The JNI environment. Used in all functions involving JNI |
arguments | Arguments that the function processes as its source to retrieve the data. |
formatString | C string that contains a format string as described above |
... | Depending on the format string, the function may expect a sequence of additional arguments, containing pairs of names and pointers to allocated storage (except as indicated above), where the interpretation of the extracted data is stored with the appropriate type. There should be at least as many pairs of these arguments as the number of values stored by the format specifiers. Additional arguments are ignored by the function |
EXIT_SUCCESS
if all required arguments were read and no errors occurred, otherwise EXIT_FAILURE
MissingRequiredArgumentException | if one of the required arguments are missing |
Argument Processing.
Reads data from the given arguments
and stores them according to parameter format into the locations given by the additional arguments, as if scanf() was used, but reading from arguments instead of the standard input (stdin).
env | The JNI environment. Used in all functions involving JNI |
arguments | Arguments that the function processes as its source to retrieve the data. |
formatString | C string that contains a format string as described above |
... | Depending on the format string, the function may expect a sequence of additional arguments, containing pairs of names and pointers to allocated storage (except as indicated above), where the interpretation of the extracted data is stored with the appropriate type. There should be at least as many pairs of these arguments as the number of values stored by the format specifiers. Additional arguments are ignored by the function |
EXIT_SUCCESS
if all required arguments were read and no errors occurred, otherwise EXIT_FAILURE
MissingRequiredArgumentException | if one of the required arguments are missing |
Definition at line 86 of file aida_pva_types_helper.c.
Referenced by aidaRequestBoolean(), aidaRequestBooleanArray(), aidaRequestByte(), aidaRequestByteArray(), aidaRequestDouble(), aidaRequestDoubleArray(), aidaRequestFloat(), aidaRequestFloatArray(), aidaRequestInteger(), aidaRequestIntegerArray(), aidaRequestLong(), aidaRequestLongArray(), aidaRequestShort(), aidaRequestShortArray(), aidaRequestString(), aidaRequestStringArray(), aidaRequestTable(), and aidaSetValue().
Reads data from the given arguments
and stores them according to parameter format into the locations given by the additional arguments, as if scanf() was used, but reading from arguments instead of the standard input (stdin).
The additional arguments should point to already allocated objects of the type specified by their corresponding format specifier. For strings and arrays only the pointer needs to be pre-allocated.
The only space allocated by this function is for the strings or arrays. So callers should only free strings and arrays. Even if you provide a default value for a string the pointer will be allocated memory on exit from the function, so even then you need to free it.
String space is allocated as follows:
There are a number of differences from scanf() which are best described by example:
By default all arguments referenced by format specifications are considered required unless the format specification character is preceded by o. For optional arguments the pointer provided must point to the default value. In the case of arrays and strings this will be copied into allocated storage that will need to be freed as normal.
json
and presented as: name
as "json.foo.bar" to retrieve the 0
value.jsonArray
and presented as 20
value.name
"value", then the avscanf() function will use the supplied value
parameter to get the data for that parameter unsigned char *
- interpret the input as a boolean, then extract a single byte into the corresponding variable.true
0
- integer, short, long,0.0
- float, double!0
- short, int, long, float, or doublefalse
0
- integer, short, long,0.0
- float, double0
- short, int, long, float, or doublechar *
- extract a single character into the corresponding variable.int *
- extract an integer into the corresponding variable (see l & h below).float *
- extract a floating point number (see l below).char *
- extract a string of characters into allocated space and point the corresponding variable to it.unsigned int *
- extract an unsigned integer into the corresponding variable (see l & h below).short *
- preceding d will retrieve a short e.g. "%hd".long *
, double * - preceding d will retrieve a long eg. "%ld"; preceding f will retrieve a double eg. "%lf".int
.env | The JNI environment. Used in all functions involving JNI |
arguments | Arguments that the function processes as its source to retrieve the data. |
value | For the avscanf() form this parameter holds the parsed Value given to the Channel Provider endpoint. |
formatString | C string that contains a format string as described above |
... | Depending on the format string, the function may expect a sequence of additional arguments, containing pairs of names and pointers to allocated storage (except as indicated above), where the interpretation of the extracted data is stored with the appropriate type. There should be at least as many pairs of these arguments as the number of references in the format specifiers. Additional arguments are ignored by the function |
EXIT_SUCCESS
if all required arguments were read and no errors occurred, otherwise EXIT_FAILURE
MissingRequiredArgumentException | if one of the required arguments are missing |
Reads data from the given arguments
and stores them according to parameter format into the locations given by the additional arguments, as if scanf() was used, but reading from arguments instead of the standard input (stdin).
The additional arguments should point to already allocated objects of the type specified by their corresponding format specifier. For strings and arrays only the pointer needs to be pre-allocated.
The only space allocated by this function is for the strings or arrays. So callers should only free strings and arrays. Even if you provide a default value for a string the pointer will be allocated memory on exit from the function, so even then you need to free it.
String space is allocated as follows:
There are a number of differences from scanf() which are best described by example:
By default all arguments referenced by format specifications are considered required unless the format specification character is preceded by o. For optional arguments the pointer provided must point to the default value. In the case of arrays and strings this will be copied into allocated storage that will need to be freed as normal.
json
and presented as: name
as "json.foo.bar" to retrieve the 0
value.jsonArray
and presented as 20
value.name
"value", then the avscanf() function will use the supplied value
parameter to get the data for that parameter unsigned char *
- interpret the input as a boolean, then extract a single byte into the corresponding variable.true
0
- integer, short, long,0.0
- float, double“true”
- char string“t”
- char string“yes”
- char string“y”
- char string!0
- short, int, long, float, or doublefalse
0
- integer, short, long,0.0
- float, double“false”
- char string“f”
- char string“no”
- char string“n”
- char string0
- short, int, long, float, or doublechar *
- extract a single character into the corresponding variable.int *
- extract an integer into the corresponding variable (see l & h below).float *
- extract a floating point number (see l below).char *
- extract a string of characters into allocated space and point the corresponding variable to it.unsigned int *
- extract an unsigned integer into the corresponding variable (see l & h below).short *
- preceding d will retrieve a short e.g. "%hd".long *
, double * - preceding d will retrieve a long eg. "%ld"; preceding f will retrieve a double eg. "%lf".int
.env | The JNI environment. Used in all functions involving JNI |
arguments | Arguments that the function processes as its source to retrieve the data. |
value | For the avscanf() form this parameter holds the parsed Value given to the Channel Provider endpoint. |
formatString | C string that contains a format string as described above |
... | Depending on the format string, the function may expect a sequence of additional arguments, containing pairs of names and pointers to allocated storage (except as indicated above), where the interpretation of the extracted data is stored with the appropriate type. There should be at least as many pairs of these arguments as the number of references in the format specifiers. Additional arguments are ignored by the function |
EXIT_SUCCESS
if all required arguments were read and no errors occurred, otherwise EXIT_FAILURE
MissingRequiredArgumentException | if one of the required arguments are missing |
Definition at line 250 of file aida_pva_types_helper.c.
Referenced by aidaSetValue(), and aidaSetValueWithResponse().
int endsWith | ( | const char * | str, |
char * | suffix | ||
) |
String Handling.
Check if a string str
, ends with another string suffix
.
str | the string to check. |
suffix | the suffix to look for at the end of str |
true
if str
ends with suffix
. false
String Handling.
str | the string to check. |
suffix | the suffix to look for at the end of str |
true
if str
ends with suffix
. false
Definition at line 148 of file aida_pva_server_helper.c.
Referenced by aidaRequestBoolean(), aidaRequestBooleanArray(), aidaRequestByte(), aidaRequestByteArray(), aidaRequestDouble(), aidaRequestDoubleArray(), aidaRequestFloat(), aidaRequestFloatArray(), aidaRequestInteger(), aidaRequestIntegerArray(), aidaRequestLong(), aidaRequestLongArray(), aidaRequestShort(), aidaRequestShortArray(), aidaRequestString(), aidaRequestStringArray(), aidaRequestTable(), and aidaSetValueWithResponse().
int groupNameFromUri | ( | char | groupName[], |
const char * | uri | ||
) |
URI Handling for group, secn, pmu and slacName.
Get the Display group name from a URI.
groupName | pre-allocated space to store the group name |
uri | the new format AIDA PV name |
URI Handling for group, secn, pmu and slacName.
groupName | pre-allocated space to store the group name |
uri | the new format AIDA PV name |
Definition at line 472 of file aida_pva_server_helper.c.
vmsstat_t init | ( | const char * | processName, |
bool | initMessageServices | ||
) |
Initialisation.
Call standalone_init() and set development mode flag.
processName | the name of the process being initialised |
initMessageServices | boolean to determine if the message service needs to be initialised |
Initialisation.
processName | the name of the process being initialised |
initMessageServices | boolean to determine if the message service needs to be initialised |
Definition at line 50 of file aida_pva_server_helper.c.
References STANDALONE_INIT().
Referenced by aidaServiceInit().
int pmuFromDeviceName | ( | JNIEnv * | env, |
char * | device, | ||
char * | primary, | ||
char * | micro, | ||
int4u * | unit | ||
) |
Get primary, micro and unit from a device name.
env | the JNI environment. Used in all functions involving JNI |
device | pre-allocated space to store the device |
primary | pre-allocated space to store the primary |
micro | pre-allocated space to store the micro |
unit | pre-allocated space to store the unit |
env | the JNI environment. Used in all functions involving JNI |
device | pre-allocated space to store the device |
primary | pre-allocated space to store the primary |
micro | pre-allocated space to store the micro |
unit | pre-allocated space to store the unit |
Definition at line 542 of file aida_pva_server_helper.c.
References aidaThrowNonOsException(), MICRO_LEN, PRIM_LEN, and UNABLE_TO_GET_DATA_EXCEPTION.
Referenced by aidaRequestTable().
void pmuStringFromUri | ( | char * | pmuString, |
const char * | uri | ||
) |
Get the pmu part of a URI.
pmuString | the pre-allocated space to store the pmu string |
uri | the new format AIDA PV name |
pmuString | the pre-allocated space to store the pmu string |
uri | the new format AIDA PV name |
Definition at line 523 of file aida_pva_server_helper.c.
References MAX_URI_LEN.
void releaseArray | ( | Array | array | ) |
Free up any memory allocated the given scalar array.
array | the given scalar array |
array | the given scalar array |
Definition at line 893 of file aida_pva_jni_helper.c.
References Array::count, and Array::items.
Referenced by toBooleanArray(), toByteArray(), toDoubleArray(), toFloatArray(), toIntegerArray(), toLongArray(), and toShortArray().
void releasePvAndArguments | ( | JNIEnv * | env, |
jstring | uri, | ||
const char * | pv, | ||
Arguments | arguments | ||
) |
Free up any memory allocated for the given pv and arguments.
arguments | the given arguments |
arguments | the given arguments |
Definition at line 872 of file aida_pva_jni_helper.c.
References Arguments::argumentCount, Arguments::arguments, Arguments::floatingPointValues, and Arguments::floatingPointValuesCount.
void releaseStringArray | ( | StringArray | array | ) |
Free up any memory allocated for string arrays.
array |
Definition at line 905 of file aida_pva_jni_helper.c.
References StringArray::count, and StringArray::items.
Referenced by toStringArray().
void releaseTable | ( | Table | table | ) |
Free up any memory allocated for the given table.
table | the given tables |
table | the given tables |
Definition at line 918 of file aida_pva_jni_helper.c.
References Table::_currentColumn, Table::_currentField, Table::_currentLabel, Table::columnCount, Table::ppData, Table::ppFields, Table::ppLabels, and Table::types.
Referenced by toTable().
void releaseValue | ( | Value | value | ) |
Release all allocated memory in the given value.
value | the given value' |
value | the given value' |
Definition at line 432 of file aida_pva_jni_helper.c.
References AIDA_JSON_TYPE, AIDA_NO_TYPE, ValueContents::jsonValue, Value::type, and Value::value.
void secnFromUri | ( | const char * | uri, |
int4u * | secn | ||
) |
Get secondary from pseudo secondary (containing a colon) number from URI.
e.g. BD01:BEND:BDES
=> BEND
as int4u
uri | the new format AIDA PV name |
secn | pointer to an int to store the secondary as a number |
Get secondary from pseudo secondary (containing a colon) number from URI.
BD01:BEND:BDES
=> BEND
as int4u
uri | the new format AIDA PV name |
secn | pointer to an int to store the secondary as a number |
Definition at line 489 of file aida_pva_server_helper.c.
const char * secondaryFromUri | ( | const char * | uri | ) |
Get secondary from URI.
Just points into the URI so don't go messing with it.
uri | the new format AIDA PV name |
Just points into the URI so don't go messing with it
uri | the new format AIDA PV name |
Definition at line 507 of file aida_pva_server_helper.c.
Referenced by aidaRequestStringArray().
int startsWith | ( | const char * | str, |
char * | prefix | ||
) |
Check if a string starts with another string.
str | |
prefix |
Definition at line 166 of file aida_pva_server_helper.c.
Referenced by aidaRequestLong(), aidaRequestShort(), aidaRequestString(), aidaRequestStringArray(), and aidaSetValue().
Add a column of arbitrary type to a Table.
Add the given data to the column assuming that the data has a number of rows that corresponds to the Table's rowCount. Memory will be allocated for the data of the column so the data
buffer presented can be freed up after calling this function.
The framework will release all memory associated with a Table when you return from your API implementation.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
type | the type of this Table column. |
data | the data to add to this column, a buffer of sizeof(type) * table->rowCount size. |
ieeeFormat | true if the data provided is already in ieee format. If the data is not in ieee format, usually because it has been retrieved from some backend system, this function will convert it to ieee format unless this parameter is set to true. |
Create a two column, two row Table, add data, and return.
Definition at line 755 of file aida_pva_types_helper.c.
References Table::_currentColumn, AIDA_BOOLEAN_ARRAY_TYPE, AIDA_BYTE_ARRAY_TYPE, AIDA_DOUBLE_ARRAY_TYPE, AIDA_FLOAT_ARRAY_TYPE, AIDA_INTEGER_ARRAY_TYPE, AIDA_LONG_ARRAY_TYPE, AIDA_SHORT_ARRAY_TYPE, AIDA_STRING_ARRAY_TYPE, aidaThrowNonOsException(), Table::columnCount, CONVERT_FROM_VMS_DOUBLE, CONVERT_FROM_VMS_FLOAT, ON_EXCEPTION_RETURN_VOID, Table::ppData, Table::rowCount, and UNABLE_TO_GET_DATA_EXCEPTION.
Referenced by aidaRequestTable(), aidaSetValueWithResponse(), tableAddFixedWidthStringColumn(), tableAddSingleRowBooleanColumn(), tableAddSingleRowByteColumn(), tableAddSingleRowDoubleColumn(), tableAddSingleRowFloatColumn(), tableAddSingleRowIntegerColumn(), tableAddSingleRowLongColumn(), tableAddSingleRowShortColumn(), and tableAddStringColumn().
void tableAddField | ( | JNIEnv * | env, |
Table * | table, | ||
char * | fieldName | ||
) |
Add a dynamic field to a table.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
fieldName | The name of the field to add |
Definition at line 828 of file aida_pva_types_helper.c.
References Table::_currentField, aidaThrowNonOsException(), ALLOCATE_STRING_AND_ON_ERROR_RETURN_VOID, Table::columnCount, Table::ppFields, and UNABLE_TO_GET_DATA_EXCEPTION.
void tableAddFixedWidthStringColumn | ( | JNIEnv * | env, |
Table * | table, | ||
char * | data, | ||
int | width | ||
) |
Add fixed-width string data to a column in the given Table.
This reads data from an allocated space that is rows * width with each string occupying width characters Though the strings are null terminated if there is space, there is no guarantee so an exact number of bytes is copied. Each string in the Table is allocated maximally.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a pointer to char buffer containing the fixed length strings. The strings are arranged in contiguous blocks width long. |
width | the width of the strings |
Add fixed-width string data to a column in the given Table.
Each string in the Table is allocated maximally.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a pointer to char buffer containing the fixed length strings. The strings are arranged in contiguous blocks width long. |
width | the width of the strings |
Definition at line 955 of file aida_pva_types_helper.c.
References Table::_currentColumn, AIDA_STRING_ARRAY_TYPE, ALLOCATE_FIXED_LENGTH_STRING_AND_ON_ERROR_RETURN_VOID, ON_EXCEPTION_RETURN_VOID, Table::ppData, Table::rowCount, and tableAddColumn().
Referenced by aidaRequestTable(), and aidaSetValueWithResponse().
void tableAddLabel | ( | JNIEnv * | env, |
Table * | table, | ||
char * | labelName | ||
) |
Add a dynamic column to a table.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
labelName | the label name to add |
Definition at line 847 of file aida_pva_types_helper.c.
References Table::_currentLabel, aidaThrowNonOsException(), ALLOCATE_STRING_AND_ON_ERROR_RETURN_VOID, Table::columnCount, Table::ppLabels, and UNABLE_TO_GET_DATA_EXCEPTION.
void tableAddSingleRowBooleanColumn | ( | JNIEnv * | env, |
Table * | table, | ||
unsigned char | data | ||
) |
Add a boolean column to a Table with only one row.
This function will allocate the required memory for the single unsigned char
that is required.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a pointer to an unsigned char . |
Definition at line 996 of file aida_pva_types_helper.c.
References AIDA_BOOLEAN_TYPE, and tableAddColumn().
Referenced by aidaRequestTable(), and aidaSetValueWithResponse().
void tableAddSingleRowByteColumn | ( | JNIEnv * | env, |
Table * | table, | ||
unsigned char | data | ||
) |
Add a byte column to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, an unsigned char . |
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, an unsigned char . |
Definition at line 1025 of file aida_pva_types_helper.c.
References AIDA_BYTE_TYPE, and tableAddColumn().
Referenced by aidaRequestTable().
void tableAddSingleRowDoubleColumn | ( | JNIEnv * | env, |
Table * | table, | ||
double | data, | ||
bool | ieeeDouble | ||
) |
Add a double column to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a double . |
ieeeDouble | True if the data is in ieee format, otherwise the double precision floating point number is converted from VMS to ieee format. |
Definition at line 1175 of file aida_pva_types_helper.c.
References AIDA_DOUBLE_TYPE, and tableAddColumn().
Referenced by aidaRequestTable(), and aidaSetValueWithResponse().
void tableAddSingleRowFloatColumn | ( | JNIEnv * | env, |
Table * | table, | ||
float | data, | ||
bool | ieeeFloat | ||
) |
Add a float column to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a float . |
ieeeFloat | True if the data is in ieee format, otherwise the given floating point number is converted from VMS to ieee format. |
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a float . |
ieeeFloat | True if the data is in ieee format, otherwise the given floating point number is converted from VMS to ieee format. |
Definition at line 1144 of file aida_pva_types_helper.c.
References AIDA_FLOAT_TYPE, and tableAddColumn().
Referenced by aidaRequestTable().
void tableAddSingleRowIntegerColumn | ( | JNIEnv * | env, |
Table * | table, | ||
int | data | ||
) |
Add a integer column to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
data | the data to add to this column, an int |
Definition at line 1083 of file aida_pva_types_helper.c.
References AIDA_INTEGER_TYPE, and tableAddColumn().
Referenced by aidaRequestTable().
void tableAddSingleRowLongColumn | ( | JNIEnv * | env, |
Table * | table, | ||
long | data | ||
) |
Add a long column to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
data | the data to add to this column. A long value |
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
data | the data to add to this column. A long value |
Definition at line 1113 of file aida_pva_types_helper.c.
References AIDA_LONG_TYPE, and tableAddColumn().
Referenced by aidaRequestTable().
void tableAddSingleRowShortColumn | ( | JNIEnv * | env, |
Table * | table, | ||
short | data | ||
) |
Add a short column to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | The Table to add the column to. |
data | The data to add to this column, a short . |
Definition at line 1054 of file aida_pva_types_helper.c.
References AIDA_SHORT_TYPE, and tableAddColumn().
Referenced by aidaRequestTable().
void tableAddSingleRowStringColumn | ( | JNIEnv * | env, |
Table * | table, | ||
char * | data | ||
) |
Add a string column to a Table with only one row.
This is a shortcut Table function that simplifies adding a string to a Table with only one row.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the column to. |
data | the data to add to this column. A single string. |
Definition at line 1205 of file aida_pva_types_helper.c.
References tableAddStringColumn().
Referenced by aidaRequestTable().
void tableAddStringColumn | ( | JNIEnv * | env, |
Table * | table, | ||
char ** | data | ||
) |
Add a String column to the given Table.
This reads data from a buffer that is itself a list of pointers to strings. We allocate just enough space to store the strings in our Table. This is allocated in one buffer so there is only one pointer to release.
env | The JNI environment. Used in all functions involving JNI. |
table | the Table to add the string column to. |
data | the data to add to this column, a buffer of sizeof(char *) * table->rowCount size. This will contain the strings to be added to the Table. |
Create a single column, one row Table, add data, and return.
Definition at line 912 of file aida_pva_types_helper.c.
References Table::_currentColumn, AIDA_STRING_ARRAY_TYPE, ALLOCATE_STRING_AND_ON_ERROR_RETURN_VOID, ON_EXCEPTION_RETURN_VOID, Table::ppData, Table::rowCount, and tableAddColumn().
Referenced by aidaRequestTable(), and tableAddSingleRowStringColumn().
Table tableCreate | ( | JNIEnv * | env, |
int | rows, | ||
int | columns | ||
) |
Table Handling.
Make a Table for return to client. This is the first call that needs to be made to return a Table. This will create a Table with the specified the number of rows and columns. You need to call tableAddColumn(), tableAddStringColumn(), or any of the other special tableAdd
functions to add columns to the Table before returning it.
env | The JNI environment. Used in all functions involving JNI. |
rows | the number of rows to create the Table with. |
columns | the number of columns to create the Table with, |
Create a two column, two row Table, add data, and return.
Table Handling.
This is the first call that needs to be made to return a Table. This will create a Table with the specified the number of rows and columns. You need to call tableAddColumn(), tableAddStringColumn(), or any of the other special tableAdd
functions to add columns to the Table before returning it.
env | The JNI environment. Used in all functions involving JNI. |
rows | the number of rows to create the Table with. |
columns | the number of columns to create the Table with, |
Create a two column, two row Table, add data, and return.
Definition at line 672 of file aida_pva_types_helper.c.
References Table::_currentColumn, AIDA_INTERNAL_EXCEPTION, aidaThrowNonOsException(), ALLOCATE_MEMORY_AND_ON_ERROR_RETURN_, Table::columnCount, Table::ppData, Table::rowCount, and Table::types.
Referenced by aidaRequestTable(), aidaSetValueWithResponse(), and tableCreateDynamic().
Table tableCreateDynamic | ( | JNIEnv * | env, |
int | rows, | ||
int | columns | ||
) |
Make a Dynamic Table for return to client.
This is the first call that needs to be made to return a Dynamic Table. This will create a Table with the specified the number of rows and columns. You need to call tableAddColumn(), tableAddStringColumn(), tableAddField(), tableAddLabel(), or any of the other special tableAdd
functions to add columns to the Table before returning it. Calling tableAddField(), and tableAddLabel() are mandatory
env | The JNI environment. Used in all functions involving JNI. |
rows | the number of rows to create the Table with. |
columns | the number of columns to create the Table with, |
Create a two column, two row Table, Set Field names, and labels, add data, and return.
Definition at line 692 of file aida_pva_types_helper.c.
References Table::_currentField, Table::_currentLabel, ALLOCATE_MEMORY_AND_ON_ERROR_RETURN_, ON_EXCEPTION_RETURN_, Table::ppFields, Table::ppLabels, and tableCreate().
Referenced by aidaRequestTable().
void uriLegacyName | ( | char | legacyName[MAX_URI_LEN], |
const char * | uri | ||
) |
Convert the given URI to the legacy AIDA name for low level functions that still require it that way.
legacyName | pointer to space to store the legacy AIDA name |
uri | the new format AIDA PV name |
legacyName | pointer to space to store the legacy AIDA name |
uri | the new format AIDA PV name |
Definition at line 599 of file aida_pva_server_helper.c.
void uriToSlcName | ( | char | slcName[MAX_URI_LEN], |
const char * | uri | ||
) |
Convert all URIs to slac names before making queries.
slcName | pointer to space to store the SLC name |
uri | the new format AIDA PV name |
slcName | pointer to space to store the SLC name |
uri | the new format AIDA PV name |
Definition at line 583 of file aida_pva_server_helper.c.