C/C++ Datatypes API¶
Defines
-
call_python(x, format, ...)¶
Macro wrapping call to PyObject_CallFunction.
Typedefs
-
typedef struct generic_ref_t generic_ref_t¶
C-friendly wrapper for rapidjson::Value.
-
typedef struct va_list_t va_list_t¶
Structure used to wrap va_list and allow pointer passing.
- Param va:
va_list Wrapped variable argument list.
-
typedef python_t python_class_t¶
C-friendly defintion of Python class object.
-
typedef python_t python_function_t¶
C-friendly defintion of Python function object.
-
typedef char *unicode_t¶
Aliases to allow differentiation in parsing model definition.
-
typedef char *string_t¶
-
typedef char *bytes_t¶
-
typedef struct comm_head_t comm_head_t¶
Header information passed by comms for multipart messages.
Functions
-
void *type_from_pyobj_c(PyObject *pyobj)¶
C wrapper for the C++ type_from_pyobj function.
- Parameters:
pyobj – void* Pointer to const rapidjson::Value type doc.
- Returns:
void* Pointer to rapidjson::Document.
-
int is_dtype_format_array(dtype_t *type_struct)¶
Determine if a datatype was created from a format.
- Parameters:
type_struct – [in] dtype_t* Datatype structure.
- Returns:
int 1 if the datatype was created from a format, 0 if it was not, -1 if there is an error.
-
const char *schema2name_c(void *schema)¶
Get the name of the type described by the datatype schema.
- Parameters:
schema – [in] Datatype schema.
- Returns:
Name.
-
const char *dtype2name(dtype_t *type_struct)¶
Get the name of the type described by the datatype schema.
- Parameters:
type_struct – [in] dtype_t* Datatype structure.
- Returns:
Name.
-
generic_t init_generic()¶
Initialize an empty generic object.
- Returns:
generic_t New generic object structure.
-
generic_t init_generic_null()¶
Initialize an empty generic object with a null JSON document.
- Returns:
generic_t New generic object structure.
-
generic_t init_generic_array()¶
Initialize an empty array of mixed types with generic wrappers.
- Returns:
generic_t New generic object structure containing an empty array.
-
generic_t init_generic_map()¶
Initialize an empty map (JSON object) of mixed types with generic wrappers.
- Returns:
generic_t New generic object structure contaiing an empty map (JSON object).
-
int is_generic_init(generic_t x)¶
Determine if a generic structure is initialized.
- Parameters:
x – [in] generic_t Generic structure to test.
- Returns:
int 1 if the structure is initialized, 0 otherwise.
-
int destroy_generic(generic_t *x)¶
Create a generic object from the provided information.
Destroy a generic object.
- Parameters:
type_class – [in] dtype_t* Type structure/class.
data – [in] void* Pointer to data.
nbytes – [in] size_t Size of data.
x – [in] generic_t* Pointer to generic object structure to destory.
- Returns:
generic_t Pointer to new generic object structure.
- Returns:
int -1 if unsuccessful, 0 otherwise.
-
int copy_generic_into(generic_t *dst, generic_t src)¶
Copy data from one generic object into another.
- Parameters:
dst – [inout] Pointer to destination object.
src – [in] Source object.
- Returns:
int -1 if unsuccessful, 0 otherwise.
-
void display_generic(generic_t x)¶
Display information about the generic type.
- Parameters:
x – [in] generic_t* Wrapper for generic object.
- NESTED_BASICS_ (array, index, const size_t) NESTED_BASICS_(map
- const char *int add_generic_array (generic_t arr, generic_t x)
Add an element to the end of an array of generic elements.
-
int set_generic_array(generic_t arr, const size_t i, generic_t x)¶
Set an element in the array at a given index to a new value.
-
int get_generic_array(generic_t arr, const size_t i, generic_t *x)¶
Get an element from an array.
- Parameters:
arr – [in] generic_t Array to get element from.
i – [in] size_t Index of element to get.
x – [out] generic_t* Pointer to address where element should be stored.
- Returns:
int Flag that is 1 if there is an error and 0 otherwise.
-
int get_generic_array_ref(generic_t arr, const size_t i, generic_ref_t *x)¶
-
int set_generic_object(generic_t arr, const char *k, generic_t x)¶
Set an element in the object at for a given key to a new value.
-
int get_generic_object(generic_t arr, const char *k, generic_t *x)¶
Get an element from an object.
- Parameters:
arr – [in] generic_t Object to get element from.
k – [in] const char* Key of element to return.
x – [out] generic_t* Pointer to address where element should be stored.
- Returns:
int Flag that is 1 if there is an error and 0 otherwise.
-
int get_generic_object_ref(generic_t arr, const char *k, generic_ref_t *x)¶
-
size_t generic_array_get_size(generic_t x)¶
Get the number of elements in an array object.
- Parameters:
x – [in] generic_t Generic object that is presumed to contain an array.
- Returns:
size_t Number of elements in array.
-
size_t generic_map_get_size(generic_t x)¶
Get the number of elements in an map object.
- Parameters:
x – [in] generic_t Generic object that is presumed to contain a map.
- Returns:
size_t Number of elements in map.
-
int generic_map_has_key(generic_t x, char *key)¶
Determine if a map object has a certain key.
- Parameters:
x – [in] generic_t Generic object that is presumed to contain a map.
key – [in] char* Key to check for.
- Returns:
int 1 if the key is present, 0 otherwise.
-
size_t generic_map_get_keys(generic_t x, char ***keys)¶
Get the keys in a map object.
- Parameters:
x – [in] generic_t Generic object that is presumed to contain a map.
keys – [out] char*** Pointer to memory where array of keys should be stored.
- Returns:
size_t Number of keys in map.
-
void *generic_ref_get_item(generic_ref_t x, const char *type)¶
-
STD_JSON_(bool, bool)¶
-
STD_JSON_(integer, int)¶
-
STD_JSON_(null, void*)¶
-
STD_JSON_(number, double)¶
-
STD_JSON_(string, const char*)¶
-
STD_JSON_NESTED_(object)¶
-
STD_JSON_NESTED_(array)¶
-
STD_JSON_NESTED_(any)¶
-
STD_JSON_NESTED_(schema)¶
-
SCALAR_(int8, int8_t)¶
-
SCALAR_(int16, int16_t)¶
-
SCALAR_(int32, int32_t)¶
-
SCALAR_(int64, int64_t)¶
-
SCALAR_(uint8, uint8_t)¶
-
SCALAR_(uint16, uint16_t)¶
-
SCALAR_(uint32, uint32_t)¶
-
SCALAR_(uint64, uint64_t)¶
-
SCALAR_(float, float)¶
-
SCALAR_(double, double)¶
-
COMPLEX_(complex_float, complex_float_t)¶
-
COMPLEX_(complex_double, complex_double_t)¶
-
SCALAR_(long_double, long double)¶
-
COMPLEX_(complex_long_double, complex_long_double_t)¶
-
PYTHON_(python_class)¶
-
PYTHON_(python_function)¶
-
PYTHON_(python_instance)¶
-
void destroy_python(python_t *x)¶
Destroy a structure containing a Python object.
topic/timesync
- Parameters:
x – [in] python_t* Pointer to Python object structure that should be freed.
-
python_t copy_python(python_t x)¶
Copy a Python object structure (NOTE: this dosn’t copy the underlying Python object but does increment the reference count).
- Parameters:
x – [in] python_t Structure containing Python object to copy.
- Returns:
python_t Copy of x.
-
void display_python(python_t x)¶
Display a Python object structure.
- Parameters:
x – [in] python_t Structure containing Python object to display.
-
void destroy_python_function(python_function_t *x)¶
Destroy a structure containing a Python function object.
- Parameters:
x – [in] python_function_t* Pointer to Python function structure that should be freed.
-
int skip_va_elements(const dtype_t *dtype, va_list_t *ap, bool set)¶
Skip datatype arguments.
- Parameters:
dtype – [in] dtype_t* Type structure to skip arguments for.
ap – [inout] va_list_t Variable argument list.
set – [in] If true, the skipped arguments are assumed to be pointers for setting.
- Returns:
int 1 if there are no errors, 0 otherwise.
-
int is_empty_dtype(const dtype_t *dtype)¶
Determine if a datatype is empty.
- Parameters:
dtype – [in] dtype_t* Type structure to test.
- Returns:
int 1 if dtype is empty, 0 otherwise.
-
const char *dtype_name(const dtype_t *type_class)¶
Get the name of the type from the class.
- Parameters:
type_class – [in] dtype_t* Type structure/class.
- Returns:
const char* Type name.
-
const char *dtype_subtype(const dtype_t *type_class)¶
Get the subtype of the type.
- Parameters:
type_class – [in] dtype_t* Type structure/class.
- Returns:
const char* The subtype of the class, “” if there is an error.
-
const size_t dtype_precision(const dtype_t *type_class)¶
Get the precision of the type.
- Parameters:
type_class – [in] dtype_t* Type structure/class.
- Returns:
const size_t The precision of the class, 0 if there is an error.
-
dtype_t *complete_dtype(dtype_t *dtype, const bool use_generic)¶
Initialize a datatype structure including setting the type string.
- Parameters:
dtype – [in] dtype_t* Type structure/class.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Initialized type structure/class.
-
dtype_t *create_dtype_from_schema(const char *schema, const bool use_generic)¶
Construct a type object from a JSON schema.
- Parameters:
schema – [in] Serialized JSON schema.
use_generic – [in] If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_empty(const bool use_generic)¶
Construct and empty type object.
- Parameters:
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_python(PyObject *pyobj, const bool use_generic)¶
Create a datatype based on a Python dictionary.
- Parameters:
pyobj – [in] PyObject* Python dictionary.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_direct(const bool use_generic)¶
Construct a Direct type object.
- Parameters:
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_default(const char *type, const bool use_generic)¶
Construct a type object for one of the default JSON types.
- Parameters:
type – [in] char* Name of the type.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_scalar(const char *subtype, const size_t precision, const char *units, const bool use_generic)¶
Construct a Scalar type object.
- Parameters:
subtype – [in] char* Name of the scalar subtype (e.g. int, uint, float, bytes).
precision – [in] size_t Precision of the scalar in bits.
units – [in] char* Units for scalar. (e.g. “cm”, “g”, “” for unitless)
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_1darray(const char *subtype, const size_t precision, const size_t length, const char *units, const bool use_generic)¶
Construct a 1D array type object.
- Parameters:
subtype – [in] char* Name of the array subtype (e.g. int, uint, float, bytes).
precision – [in] size_t Precision of the array in bits.
length – [in] size_t Number of elements in the array.
units – [in] char* Units for array elements. (e.g. “cm”, “g”, “” for unitless)
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_ndarray(const char *subtype, const size_t precision, const size_t ndim, const size_t *shape, const char *units, const bool use_generic)¶
Construct a ND array type object.
- Parameters:
subtype – [in] char* Name of the array subtype (e.g. int, uint, float, bytes).
precision – [in] size_t Precision of the array in bits.
ndim – [in] size_t Number of dimensions in the array (and therefore also the number of elements in shape).
shape – [in] size_t* Pointer to array where each element is the size of the array in that dimension.
units – [in] char* Units for array elements. (e.g. “cm”, “g”, “” for unitless)
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_ndarray_arr(const char *subtype, const size_t precision, const size_t ndim, const int64_t shape[], const char *units, const bool use_generic)¶
Construct a ND array type object.
- Parameters:
subtype – [in] char* Name of the array subtype (e.g. int, uint, float, bytes).
precision – [in] size_t Precision of the array in bits.
ndim – [in] size_t Number of dimensions in the array (and therefore also the number of elements in shape).
shape[] – [in] size_t Array where each element is the size of the array in that dimension.
units – [in] char* Units for array elements. (e.g. “cm”, “g”, “” for unitless)
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_json_array(const size_t nitems, dtype_t **items, const bool use_generic)¶
Construct a JSON array type object.
- Parameters:
nitems – [in] size_t Number of types in items.
items – [in] dtype_t** Pointer to array of types describing the array elements.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_json_object(const size_t nitems, char **keys, dtype_t **values, const bool use_generic)¶
Construct a JSON object type object.
- Parameters:
nitems – [in] size_t Number of keys/types in keys and values.
keys – [in] char** Pointer to array of keys for each type.
values – [in] dtype_t** Pointer to array of types describing the values for each key.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_ply(const bool use_generic)¶
Construct a Ply type object.
- Parameters:
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_obj(const bool use_generic)¶
Construct a Obj type object.
- Parameters:
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_ascii_table(const char *format_str, const int as_array, const bool use_generic)¶
Construct an AsciiTable type object.
- Parameters:
format_str – [in] const char* C-style format string that will be used to determine the type of elements in arrays that will be serialized/deserialized using the resulting type.
as_array – [in] int If 1, the types will be arrays. Otherwise they will be scalars.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_format(const char *format_str, const int as_array, const bool use_generic)¶
Construct a type object based on the provided format string.
- Parameters:
format_str – [in] const char* C-style format string that will be used to determine the type of elements in arrays that will be serialized/deserialized using the resulting type.
as_array – [in] int If 1, the types will be arrays. Otherwise they will be scalars.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_pyobj(const char *type, const bool use_generic)¶
Construct a type object for Python objects.
- Parameters:
type – [in] char* Type string.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_pyinst(const char *class_name, dtype_t *args_dtype, dtype_t *kwargs_dtype, const bool use_generic)¶
Construct a type object for Python object instances.
- Parameters:
class_name – [in] char* Python class name.
args_dtype – [in] dtype_t* Datatype describing the arguments creating the instance.
kwargs_dtype – [in] dtype_t* Datatype describing the keyword arguments creating the instance.
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_schema(const bool use_generic)¶
Construct a type object for a schema.
- Parameters:
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
dtype_t *create_dtype_any(const bool use_generic)¶
Construct a type object for receiving any type.
- Parameters:
use_generic – [in] bool If true, serialized/deserialized objects will be expected to be generic_t instances.
- Returns:
dtype_t* Type structure/class.
-
int destroy_document(void **obj)¶
Wrapper for freeing rapidjson::Document class.
- Parameters:
obj – [in] Pointer to rapidjson::Document.
- Returns:
int 0 if free was successfull, -1 if there was an error.
-
int destroy_dtype(dtype_t **dtype)¶
Wrapper for freeing rapidjson::Document class wrapper struct.
- Parameters:
dtype – [in] dtype_t** Wrapper struct for C++ rapidjson::Document.
- Returns:
int 0 if free was successfull, -1 if there was an error.
-
comm_head_t init_header()¶
Initialize a header struct.
- Returns:
comm_head_t Structure with provided information, char arrays correctly initialized to empty strings if NULLs provided.
-
comm_head_t create_send_header(dtype_t *datatype, const char *msg, const size_t len)¶
Create a header for sending messages.
- Parameters:
datatype – [in] Datatype for messages that will be sent.
- Returns:
initialized header.
-
comm_head_t create_recv_header(char **data, const size_t len, size_t msg_len, int allow_realloc, int temp)¶
Create a header for receiving messages.
- Parameters:
data – [in] Pointer to string containing serialized header.
len – [in] Length of buffer containing serialized message.
msg_len – [in] Length of message in buffer.
allow_realloc – [in] If true, data target can be reallocated.
temp – [in] If true, the header is temporary.
-
HEADER_GET_SET_METHOD_(int, Int)¶
-
HEADER_GET_SET_METHOD_(bool, Bool)¶
-
HEADER_GET_SET_METHOD_(const char*, String)¶
-
int header_SetMetaID(comm_head_t *head, const char *name, const char **id)¶
-
int destroy_header(comm_head_t *x)¶
Destroy a header object.
- Parameters:
x – [in] comm_head_t* Pointer to the header that should be destroyed.
- Returns:
int 0 if successful, -1 otherwise.
-
void invalidate_header(comm_head_t *x)¶
Set flags to mark header as invalid.
- Parameters:
x – [in] Header to modify.
-
int header_is_valid(const comm_head_t head)¶
Check if a header is valid.
- Parameters:
head – [in] Header to check.
- Returns:
1 if valid, 0 otherwise.
-
int header_is_multipart(const comm_head_t head)¶
Check if a header is for a multipart message.
- Parameters:
head – [in] Header to check.
- Returns:
1 if multipart, 0 otherwise.
-
void *header_schema(comm_head_t head)¶
Get schema from header.
- Parameters:
head – [in] Header to get schema from.
- Returns:
Header schema.
-
int format_comm_header(comm_head_t *head, char **headbuf, const char *buf, size_t buf_siz, const size_t max_size, const int no_type)¶
Format header to a string.
- Parameters:
head – [in] Pointer to header to be formatted.
headbuf – [out] Pointer to buffer where header should be written.
buf – [in] Message being sent.
buf_siz – [in] Size of buf.
max_size – [in] Maximum size that header can occupy before the type should be moved to the data portion of the message.
no_type – [in] If 1, type information will not be added to the header. If 0, it will be.
- Returns:
: Size of header written.
-
int finalize_header_recv(comm_head_t head, dtype_t *dtype)¶
Finalize header from complete data.
- Parameters:
head – [inout] Header structure that should be finalized.
dtype – [inout] Datatype to update if type information is contained in the data.
- Returns:
: int -1 if there is an error, 0 otherwise.
-
dtype_t *copy_dtype(const dtype_t *dtype)¶
Get a copy of a type structure.
- Parameters:
dtype – [in] dtype_t* Wrapper struct for C++ rapidjson::Document.
- Returns:
: dtype_t* Type class.
-
int update_dtype(dtype_t *dtype1, void *schema2)¶
Wrapper for updating a type object with information from another.
- Parameters:
dtype1 – [in] Wrapper struct for C++ rapidjson::Document that should be updated.
schema2 – [in] C++ rapidjson::Document that should be updated from.
- Returns:
: int 0 if successfull, -1 if there was an error.
-
int update_dtype_from_generic_ap(dtype_t *dtype1, va_list_t ap)¶
Wrapper for updatining a type object with information from the provided variable arguments if a generic structure is present.
- Parameters:
dtype1 – [in] dtype_t* Wrapper struct for C++ rapidjson::Document that should be updated.
ap – [in] va_list_t Variable argument list.
- Returns:
: int 0 if successfull, -1 if there was an error.
-
int update_precision_dtype(dtype_t *dtype, const size_t new_precision)¶
Wrapper for updating the precision of a bytes or unicode scalar type.
- Parameters:
dtype – [in] dtype_t* Wrapper struct for C++ rapidjson::Document.
new_precision – [in] size_t New precision.
- Returns:
: int 0 if free was successfull, -1 if there was an error.
-
int deserialize_dtype(const dtype_t *dtype, const char *buf, const size_t buf_siz, va_list_t ap)¶
Wrapper for deserializing from a data type.
- Parameters:
dtype – [in] dtype_t* Wrapper struct for C++ rapidjson::Document.
buf – [in] character pointer to serialized message.
buf_siz – [in] size_t Size of buf.
ap – [in] va_list Arguments to be parsed from message. returns: int The number of populated arguments. -1 indicates an error.
-
int serialize_dtype(const dtype_t *dtype, char **buf, size_t *buf_siz, const int allow_realloc, va_list_t ap)¶
Wrapper for serializing from a data type.
- Parameters:
dtype – [in] dtype_t* Wrapper struct for C++ rapidjson::Document.
buf – [in] character pointer to pointer to memory where serialized message should be stored.
buf_siz – [in] size_t Size of memory allocated to buf.
allow_realloc – [in] int If 1, buf will be realloced if it is not big enough to hold the serialized emssage. If 0, an error will be returned.
ap – [in] va_list Arguments to be formatted. returns: int The length of the serialized message or -1 if there is an error.
-
void display_dtype(const dtype_t *dtype, const char *indent)¶
Wrapper for displaying a data type.
- Parameters:
dtype – [in] dtype_t* Wrapper struct for C++ rapidjson::Document.
indent – [in] char* Indentation to add to display output.
-
size_t nargs_exp_dtype(const dtype_t *dtype, const int for_fortran_recv)¶
Wrapper for determining how many arguments a data type expects.
- Parameters:
dtype – [in] Wrapper struct for C++ rapidjson::Document.
for_fortran_recv – [in] If 1, additional variables passed by the Fortran interface during receive calls will be considered.
-
void set_obj(obj_t *x, void *obj, int copy)¶
Set parameters from a rapidjson::ObjWavefront object.
- Parameters:
x – [inout] Structure to modify.
obj – [in] rapidjson::ObjWavefront object to copy.
copy – [in] If 1, the provided object will be copied, otherwise the pointer will be added to the structured directly and it will be freed on destruction.
-
obj_t copy_obj(obj_t src)¶
Copy an obj structure.
- Parameters:
src – [in] obj_t Obj structure that should be copied.
- Returns:
Copy of obj structure.
-
void display_obj_indent(obj_t p, const char *indent)¶
Display the information contained by an Obj struct.
- Parameters:
p – [in] obj_t Obj structure.
indent – [in] const char* Indentation that should be added to each line.
-
void display_obj(obj_t p)¶
Display the information contained by an Obj struct.
- Parameters:
p – [in] obj_t Obj structure.
-
int nelements_obj(obj_t p, const char *name)¶
Get the number of elements of a certain type in the structure.
- Parameters:
p – [in] obj_t ObjWavefront structure.
name – [in] Name of element type to count.
-
void set_ply(ply_t *x, void *obj, int copy)¶
Set parameters from a rapidjson::Ply object.
- Parameters:
x – [inout] Structure to modify.
obj – [in] rapidjson::Ply object to copy.
copy – [in] If 1, the provided object will be copied, otherwise the pointer will be added to the structured directly and it will be freed on destruction.
-
ply_t copy_ply(ply_t src)¶
Copy a ply structure.
- Parameters:
src – [in] ply_t Ply structure that should be copied.
- Returns:
Copy of ply structure.
-
void display_ply_indent(ply_t p, const char *indent)¶
Display the information contained by a Ply struct.
- Parameters:
p – [in] ply_t Ply structure.
indent – [in] const char* Indentation that should be added to each line.
-
void display_ply(ply_t p)¶
Display the information contained by a Ply struct.
- Parameters:
p – [in] ply_t Ply structure.
-
int nelements_ply(ply_t p, const char *name)¶
Get the number of elements of a certain type in the structure.
- Parameters:
p – [in] ply_t Ply structure.
name – [in] Name of element type to count.
-
int init_python_API()¶
Initialize Python if it is not initialized.
- Returns:
int 0 if successful, other values indicate errors.
-
va_list_t init_va_list(size_t *nargs, int allow_realloc, int for_c)¶
Initialize a variable argument list from an existing va_list.
- Parameters:
nargs – [in] Pointer to argument count.
allow_realloc – [in] If int, arguments in va will be reallocated as necessary to receiving message contents.
for_c – [in] If 1, the arguments are treated as coming from C with C++ classes wrapped in structures.
- Returns:
va_list_t New variable argument list structure.
-
va_list_t init_va_ptrs(const size_t nptrs, void **ptrs, int allow_realloc, int for_fortran)¶
Initialize a variable argument list from an array of pointers.
- Parameters:
nptrs – [in] Number of pointers.
ptrs – [in] Array of pointers.
allow_realloc – [in] If int, arguments in va will be reallocated as necessary to receiving message contents.
for_fortran – [in] If 1, it is assumed that the passed pointers are passed from the fortran interface.
- Returns:
va_list_t New variable argument list structure.
-
va_list *get_va_list(va_list_t ap)¶
Get pointer to va_list.
- Parameters:
ap – [in] Variable argument list.
- Returns:
Pointer to variable argument list.
-
void end_va_list(va_list_t *ap)¶
Finalize a variable argument list.
- Parameters:
ap – [in] va_list_t Variable argument list.
-
void clear_va_list(va_list_t *ap)¶
Clear argument list.
- Parameters:
ap – [inout] Variable argument list to clear.
-
size_t size_va_list(va_list_t va)¶
Get the number of arguments remaining in a variable argument list.
- Parameters:
ap – [in] Variable argument list.
- Returns:
Number of arguments remaining.
-
void set_va_list_size(va_list_t va, size_t *nargs)¶
Set the size of the variable argument list.
- Parameters:
ap – [in] Variable argument list.
nargs – [in] Pointer to argument count.
Variables
- key
-
struct dtype_t
- #include <datatypes.h>
C-friendly definition of rapidjson::Document.
Public Members
-
void *metadata¶
Pointer ot rapidjson::Document containing additional metadata.
-
void *metadata¶
-
struct generic_t
- #include <datatypes.h>
C-friendly wrapper for rapidjson::Document.
Public Members
-
void *obj¶
Pointer to rapidjson::Document.
-
void *obj¶
-
struct generic_ref_t
- #include <datatypes.h>
C-friendly wrapper for rapidjson::Value.
-
struct va_list_t
- #include <datatypes.h>
Structure used to wrap va_list and allow pointer passing.
- Param va:
va_list Wrapped variable argument list.
Public Members
-
void *va¶
-
struct comm_head_t
- #include <datatypes.h>
Header information passed by comms for multipart messages.
Public Members
-
size_t *size_data¶
Size of incoming message.
-
size_t *size_buff¶
Size of message buffer;.
-
size_t *size_curr¶
Size of current message.
-
size_t *size_head¶
Size of header in incoming message.
-
uint16_t *flags¶
Bit flags encoding the status of the header.
-
void *head¶
C++ header structure.
-
void *metadata¶
Additional user defined options in rapidjson::Value.
-
size_t *size_data¶
-
struct obj_t
- #include <ObjSerialize.h>
-
struct ply_t
- #include <PlySerialize.h>
Warning
autodoxygenfile: Cannot find file “MetaschemaType.h
Warning
autodoxygenfile: Cannot find file “ScalarMetaschemaType.h
Warning
autodoxygenfile: Cannot find file “JSONArrayMetaschemaType.h
Warning
autodoxygenfile: Cannot find file “JSONObjectMetaschemaType.h
Warning
autodoxygenfile: Cannot find file “AsciiTableMetaschemaType.h
Warning
autodoxygenfile: Cannot find file “PlyMetaschemaType.h
Warning
autodoxygenfile: Cannot find file “ObjMetaschemaType.h
Warning
autodoxygenfile: Cannot find file “DirectMetaschemaType.h