OSFI-C++
3.9.3
OpenSF Integration Library
|
Foreign-function interface to the ConFM module of OSFI-C++. More...
#include "ffi_base.h"
Go to the source code of this file.
Foreign-function interface to the ConFM module of OSFI-C++.
This file exposes an interface to the OSFI functions that can be called without C++ name mangling or other C++-specific features such as exception handling. It is not the OSFI-C interface, which resides in "OSFIC.h". It is intended as an intermediate layer to create bindings to OSFI-C++ from other languages; currently C and Fortran are supported through it.
#define OSFI_DECL_GETTERS | ( | Tname, | |
Ttype, | |||
kind | |||
) |
#define OSFI_DECL_SCALAR_GETTER_simple | ( | Tname, | |
Ttype | |||
) |
#define OSFI_DECL_SCALAR_GETTER_str | ( | Tname, | |
Ttype | |||
) |
typedef struct OSFI_Parameter_t OSFI_Parameter |
Parameter object, in the FFI.
typedef struct OSFI_ParamReader_t OSFI_ParamReader |
ParamReader object, in the FFI.
typedef struct OSFI_Vec_Tboolean_t OSFI_Vec_Tboolean |
Anonymous type in the FFI for an OSFI-managed vector of type "boolean" (element type bool
).
typedef struct OSFI_Vec_Tdouble_t OSFI_Vec_Tdouble |
Anonymous type in the FFI for an OSFI-managed vector of type "double" (element type double
).
typedef struct OSFI_Vec_Tfile_t OSFI_Vec_Tfile |
Anonymous type in the FFI for an OSFI-managed vector of type "file" (element type char*
).
typedef struct OSFI_Vec_Tinteger_t OSFI_Vec_Tinteger |
Anonymous type in the FFI for an OSFI-managed vector of type "integer" (element type int
).
typedef struct OSFI_Vec_Tstring_t OSFI_Vec_Tstring |
Anonymous type in the FFI for an OSFI-managed vector of type "string" (element type char*
).
typedef struct OSFI_Vec_Ttime_t OSFI_Vec_Ttime |
Anonymous type in the FFI for an OSFI-managed vector of type "time" (element type OSFI_TimeValue
).
The two possible layouts for multi-dimensional arrays.
Return values for the osfi_param_reader_valagainst function.
enum OSFI_ParamElemType |
The various types of element types that a parameter may use according to the E2E-ICD. Wraps Parameter::ElementType.
int osfi_confm_compare_timevalue | ( | const OSFI_TimeValue * | a, |
const OSFI_TimeValue * | b | ||
) |
Comparison function between TimeValue instances.
a,b | Values to compare. NULL pointers compare as less-than any non-NULL value. |
bool osfi_confm_exist_parameter | ( | const OSFI_ParamReader * | obj, |
const char * | paramName | ||
) |
Wrapper for ParamReader::existParameter
OSFI_Vec_Tboolean* osfi_confm_file_exist | ( | const OSFI_Parameter * | p, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Wraps Parameter::fileExist(). If called with a null parameter, it just returns null.
int osfi_confm_get_dimension | ( | const OSFI_Parameter * | obj, |
int | index | ||
) |
Gets the size of the given dimension for the parameter.
obj | Parameter to examine. If NULL, the function always returns zero. |
index | Dimension to query. If out of range, the return value is one. |
OSFI_Vec_Tboolean* osfi_confm_get_leaf_vector_boolean_vals | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth, | ||
int * | size | ||
) |
Get the value of a 1D slice of the N-D array with a boolean type. Wraps Parameter::getVectorX(std::vector<int>).
OSFI_Vec_Tdouble* osfi_confm_get_leaf_vector_double_vals | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth, | ||
int * | size | ||
) |
Get the value of a 1D slice of the N-D array with a double type. Wraps Parameter::getVectorX(std::vector<int>).
OSFI_Vec_Tfile* osfi_confm_get_leaf_vector_file_vals | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth, | ||
int * | size | ||
) |
Get the value of a 1D slice of the N-D array with a file type. Wraps Parameter::getVectorX(std::vector<int>).
OSFI_Vec_Tinteger* osfi_confm_get_leaf_vector_integer_vals | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth, | ||
int * | size | ||
) |
Get the value of a 1D slice of the N-D array with a integer type. Wraps Parameter::getVectorX(std::vector<int>).
OSFI_Vec_Tstring* osfi_confm_get_leaf_vector_string_vals | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth, | ||
int * | size | ||
) |
Get the value of a 1D slice of the N-D array with a string type. Wraps Parameter::getVectorX(std::vector<int>).
OSFI_Vec_Ttime* osfi_confm_get_leaf_vector_time_vals | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth, | ||
int * | size | ||
) |
Get the value of a 1D slice of the N-D array with a time type. Wraps Parameter::getVectorX(std::vector<int>).
OSFI_Vec_Tboolean* osfi_confm_get_matrix_boolean_vals | ( | const OSFI_Parameter * | obj, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Get a vector representing the matrix with a boolean type. Elements are in the chosen array element order. * Wraps Parameter::getMatrixX().
OSFI_Vec_Tdouble* osfi_confm_get_matrix_double_vals | ( | const OSFI_Parameter * | obj, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Get a vector representing the matrix with a double type. Elements are in the chosen array element order. * Wraps Parameter::getMatrixX().
OSFI_Vec_Tfile* osfi_confm_get_matrix_file_vals | ( | const OSFI_Parameter * | obj, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Get a vector representing the matrix with a file type. Elements are in the chosen array element order. * Wraps Parameter::getMatrixX().
OSFI_Vec_Tinteger* osfi_confm_get_matrix_integer_vals | ( | const OSFI_Parameter * | obj, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Get a vector representing the matrix with a integer type. Elements are in the chosen array element order. * Wraps Parameter::getMatrixX().
OSFI_Vec_Tstring* osfi_confm_get_matrix_string_vals | ( | const OSFI_Parameter * | obj, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Get a vector representing the matrix with a string type. Elements are in the chosen array element order. * Wraps Parameter::getMatrixX().
OSFI_Vec_Ttime* osfi_confm_get_matrix_time_vals | ( | const OSFI_Parameter * | obj, |
enum osfi_confm_arrayorder | aeo, | ||
int * | size | ||
) |
Get a vector representing the matrix with a time type. Elements are in the chosen array element order. * Wraps Parameter::getMatrixX().
int osfi_confm_get_node_dimension | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth | ||
) |
Gets the size of a specific subobject in an inhomogeneous array. Wraps Parameter::getDims(std::vector<int>).
obj | Parameter to examine. If NULL, the function always returns zero. |
node | Coordinates to query, 0-based. |
depth | Size of the node array. Note that inhomogeneous arrays always work in row-major (C-like) order. |
int osfi_confm_get_num_dims | ( | const OSFI_Parameter * | obj | ) |
Wraps Parameter::getNdims().
const OSFI_Parameter* osfi_confm_get_param | ( | const OSFI_ParamReader * | obj, |
const char * | paramName | ||
) |
Wrapper for ParamReader::getParameterRef. Logs an error and returns a null pointer if the parameter name does not exist.
void osfi_confm_get_parameter | ( | const OSFI_Parameter * | obj, |
char * | name, | ||
char * | description, | ||
char * | value, | ||
char * | units, | ||
int * | dims, | ||
char * | max, | ||
char * | min, | ||
int * | type | ||
) |
bool osfi_confm_get_scalar_boolean | ( | const OSFI_Parameter * | obj, |
bool * | value | ||
) |
Get a scalar value of type boolean . On a parsing error, returns false and does not write on value.
bool osfi_confm_get_scalar_double | ( | const OSFI_Parameter * | obj, |
double * | value | ||
) |
Get a scalar value of type double . On a parsing error, returns false and does not write on value.
int osfi_confm_get_scalar_file | ( | const OSFI_Parameter * | obj, |
char * | buf, | ||
int | bufSz | ||
) |
Get a string-like value and return the minimum required buffer size. On a parsing error, returns a negative value.
bool osfi_confm_get_scalar_integer | ( | const OSFI_Parameter * | obj, |
int * | value | ||
) |
Get a scalar value of type integer . On a parsing error, returns false and does not write on value.
int osfi_confm_get_scalar_string | ( | const OSFI_Parameter * | obj, |
char * | buf, | ||
int | bufSz | ||
) |
Get a string-like value and return the minimum required buffer size. On a parsing error, returns a negative value.
bool osfi_confm_get_scalar_time | ( | const OSFI_Parameter * | obj, |
OSFI_TimeValue * | value | ||
) |
Get a scalar value of type time . On a parsing error, returns false and does not write on value.
OSFI_Vec_Tboolean* osfi_confm_get_vector_boolean_vals | ( | const OSFI_Parameter * | obj, |
int * | size | ||
) |
Get the value of a 1D vector with a boolean type. Wraps Parameter::getVectorX().
OSFI_Vec_Tdouble* osfi_confm_get_vector_double_vals | ( | const OSFI_Parameter * | obj, |
int * | size | ||
) |
Get the value of a 1D vector with a double type. Wraps Parameter::getVectorX().
OSFI_Vec_Tfile* osfi_confm_get_vector_file_vals | ( | const OSFI_Parameter * | obj, |
int * | size | ||
) |
Get the value of a 1D vector with a file type. Wraps Parameter::getVectorX().
OSFI_Vec_Tinteger* osfi_confm_get_vector_integer_vals | ( | const OSFI_Parameter * | obj, |
int * | size | ||
) |
Get the value of a 1D vector with a integer type. Wraps Parameter::getVectorX().
OSFI_Vec_Tstring* osfi_confm_get_vector_string_vals | ( | const OSFI_Parameter * | obj, |
int * | size | ||
) |
Get the value of a 1D vector with a string type. Wraps Parameter::getVectorX().
OSFI_Vec_Ttime* osfi_confm_get_vector_time_vals | ( | const OSFI_Parameter * | obj, |
int * | size | ||
) |
Get the value of a 1D vector with a time type. Wraps Parameter::getVectorX().
bool osfi_confm_is_leaf | ( | const OSFI_Parameter * | obj, |
int | node[], | ||
int | depth | ||
) |
Checks whether the given coordinates point to a leaf node in the inhomogeneous array parameter. Wraps Parameter::isLeaf(std::vector<int>). If called with a null parameter, it always returns true.
void osfi_confm_print_parameter | ( | const OSFI_Parameter * | obj | ) |
Wraps Parameter::print(), writing information related to the given parameter to the "info" output stream. See Logger::info().
void osfi_confm_print_parameters | ( | const OSFI_ParamReader * | obj | ) |
Wrapper for ParamReader::print().
int osfi_confm_vector_boolean_copyall | ( | const OSFI_Vec_Tboolean * | v, |
bool * | arr, | ||
int | length | ||
) |
Copies all elements from a managed vector object to the given array. If length is * smaller than required or a null array is given, only returns the required length. In * case of error, returns a negative value.
void osfi_confm_vector_boolean_destroy | ( | OSFI_Vec_Tboolean ** | obj | ) |
Free and nullify a vector object. If given a null pointer or a null object, does nothing.
bool osfi_confm_vector_boolean_get | ( | const OSFI_Vec_Tboolean * | v, |
int | index | ||
) |
Get a single element from a managed vector object. No null/bounds checks are made.
int osfi_confm_vector_boolean_numel | ( | const OSFI_Vec_Tboolean * | v | ) |
Get the number of elements of a managed vector object. If given a null pointer, returns 0.
int osfi_confm_vector_double_copyall | ( | const OSFI_Vec_Tdouble * | v, |
double * | arr, | ||
int | length | ||
) |
Copies all elements from a managed vector object to the given array. If length is * smaller than required or a null array is given, only returns the required length. In * case of error, returns a negative value.
void osfi_confm_vector_double_destroy | ( | OSFI_Vec_Tdouble ** | obj | ) |
Free and nullify a vector object. If given a null pointer or a null object, does nothing.
double osfi_confm_vector_double_get | ( | const OSFI_Vec_Tdouble * | v, |
int | index | ||
) |
Get a single element from a managed vector object. No null/bounds checks are made.
int osfi_confm_vector_double_numel | ( | const OSFI_Vec_Tdouble * | v | ) |
Get the number of elements of a managed vector object. If given a null pointer, returns 0.
bool osfi_confm_vector_file_copyall | ( | const OSFI_Vec_Tfile * | v, |
char ** | strArr, | ||
int * | itemSz, | ||
int * | numItems | ||
) |
Copies all elements from a managed vector object to the given array of buffers. The two size pointers * cannot be null; they are filled with the minimum required buffer size and number of buffers on output. * Elements larger than the individual buffer size will be truncated, but as long as bufSz is not zero * they will always be null-terminated.
void osfi_confm_vector_file_destroy | ( | OSFI_Vec_Tfile ** | obj | ) |
Free and nullify a vector object. If given a null pointer or a null object, does nothing.
int osfi_confm_vector_file_get | ( | const OSFI_Vec_Tfile * | v, |
int | index, | ||
char * | buf, | ||
int | bufSz | ||
) |
Get a single element from a managed vector object and return the minimum required buffer size. If * bufSz is positive but not big enough, the element can get truncated, but it is null-terminated.
int osfi_confm_vector_file_numel | ( | const OSFI_Vec_Tfile * | v | ) |
Get the number of elements of a managed vector object. If given a null pointer, returns 0.
int osfi_confm_vector_integer_copyall | ( | const OSFI_Vec_Tinteger * | v, |
int * | arr, | ||
int | length | ||
) |
Copies all elements from a managed vector object to the given array. If length is * smaller than required or a null array is given, only returns the required length. In * case of error, returns a negative value.
void osfi_confm_vector_integer_destroy | ( | OSFI_Vec_Tinteger ** | obj | ) |
Free and nullify a vector object. If given a null pointer or a null object, does nothing.
int osfi_confm_vector_integer_get | ( | const OSFI_Vec_Tinteger * | v, |
int | index | ||
) |
Get a single element from a managed vector object. No null/bounds checks are made.
int osfi_confm_vector_integer_numel | ( | const OSFI_Vec_Tinteger * | v | ) |
Get the number of elements of a managed vector object. If given a null pointer, returns 0.
bool osfi_confm_vector_string_copyall | ( | const OSFI_Vec_Tstring * | v, |
char ** | strArr, | ||
int * | itemSz, | ||
int * | numItems | ||
) |
Copies all elements from a managed vector object to the given array of buffers. The two size pointers * cannot be null; they are filled with the minimum required buffer size and number of buffers on output. * Elements larger than the individual buffer size will be truncated, but as long as bufSz is not zero * they will always be null-terminated.
void osfi_confm_vector_string_destroy | ( | OSFI_Vec_Tstring ** | obj | ) |
Free and nullify a vector object. If given a null pointer or a null object, does nothing.
int osfi_confm_vector_string_get | ( | const OSFI_Vec_Tstring * | v, |
int | index, | ||
char * | buf, | ||
int | bufSz | ||
) |
Get a single element from a managed vector object and return the minimum required buffer size. If * bufSz is positive but not big enough, the element can get truncated, but it is null-terminated.
int osfi_confm_vector_string_numel | ( | const OSFI_Vec_Tstring * | v | ) |
Get the number of elements of a managed vector object. If given a null pointer, returns 0.
int osfi_confm_vector_time_copyall | ( | const OSFI_Vec_Ttime * | v, |
OSFI_TimeValue * | arr, | ||
int | length | ||
) |
Copies all elements from a managed vector object to the given array. If length is * smaller than required or a null array is given, only returns the required length. In * case of error, returns a negative value.
void osfi_confm_vector_time_destroy | ( | OSFI_Vec_Ttime ** | obj | ) |
Free and nullify a vector object. If given a null pointer or a null object, does nothing.
OSFI_TimeValue osfi_confm_vector_time_get | ( | const OSFI_Vec_Ttime * | v, |
int | index | ||
) |
Get a single element from a managed vector object. No null/bounds checks are made.
int osfi_confm_vector_time_numel | ( | const OSFI_Vec_Ttime * | v | ) |
Get the number of elements of a managed vector object. If given a null pointer, returns 0.
enum OSFI_ParamElemType osfi_param_get_element_type | ( | const OSFI_Parameter * | obj | ) |
Wraps Parameter::getElementType().
int osfi_param_get_local_name | ( | const OSFI_Parameter * | obj, |
char * | buf, | ||
int | bufSz | ||
) |
Wraps Parameter::getLocalName(). If called with a null parameter, it returns zero.
int osfi_param_get_path | ( | const OSFI_Parameter * | obj, |
char * | buf, | ||
int | bufSz | ||
) |
Wraps Parameter::getPath(). If called with a null parameter, it returns zero.
bool osfi_param_is_array | ( | const OSFI_Parameter * | obj | ) |
Wraps Parameter::isArray().
OSFI_ParamReader* osfi_param_reader_create | ( | const char * | fileName, |
const char * | schema | ||
) |
Create an instance of the ParamReader class with the given arguments. Returns a null pointer in case of error.
OSFI_ParamReader* osfi_param_reader_create_noval | ( | const char * | fileName | ) |
Create an instance of the ParamReader class with the given arguments. Returns a null pointer in case of error.
void osfi_param_reader_destroy | ( | OSFI_ParamReader ** | obj | ) |
Call delete
on *obj and nullify the pointer. No-op if either obj or *obj are a null pointer.
enum osfi_ffi_confm_val_res osfi_param_reader_valagainst | ( | const OSFI_ParamReader * | obj, |
const char * | xsdFile | ||
) |
Wrapper for ParamReader::validateAgainst(const std::string&) and ParamReader::validateAgainstInternalSchema(). The first overload is chosen if xsdFile is not a null pointer (even if the string is empty!), the second otherwise.