![]() |
GenericContainer
GenericContaine a tool for C++ programming
|
This module provides the C interface for the GenericContainer class. More...
Classes | |
struct | c_complex_type |
A structure representing a complex number, with real and imaginary components. More... | |
Enumerations | |
enum | { GENERIC_CONTAINER_OK = 0 , GENERIC_CONTAINER_BAD_TYPE , GENERIC_CONTAINER_NO_DATA , GENERIC_CONTAINER_NOT_EMPTY , GENERIC_CONTAINER_BAD_HEAD } |
Functions | |
int | GC_new (char const id[]) |
Create a new GenericContainer object. | |
int | GC_select (char const id[]) |
Select an existing GenericContainer object. | |
int | GC_delete (char const id[]) |
Delete a GenericContainer object. | |
int | GC_fill_for_test (char const id[]) |
Fill a GenericContainer with test data. | |
int | GC_pop_head () |
Move the head pointer up one level in the GenericContainer. | |
int | GC_reset_head () |
Reset the head pointer to the first level in the GenericContainer. | |
int | GC_dump () |
Dump the contents of the current GenericContainer. | |
int | GC_print_content_types () |
Print the content types of the current GenericContainer. | |
int | GC_get_type () |
Retrieve the type of the current element pointed by the head in the GenericContainer. | |
char const * | GC_get_type_name () |
Retrieve the name of the type of the current element in the GenericContainer. | |
void * | GC_mem_ptr (char const id[]) |
Get a pointer to the internal memory of the GenericContainer object. | |
int | GC_set_bool (int a) |
int | GC_set_int (int a) |
Set the current element of the GenericContainer to an integer value. | |
int | GC_set_real (double a) |
Set the current element of the GenericContainer to a real number. | |
int | GC_set_complex (c_complex_type const *a) |
Set the current element of the GenericContainer to a complex number. | |
int | GC_set_complex2 (double re, double im) |
Set the current element of the GenericContainer to a complex number using real and imaginary parts. | |
int | GC_set_string (char const a[]) |
Set the current element of the GenericContainer to a string. | |
int | GC_get_bool () |
Retrieve the boolean value from the current element of the GenericContainer . | |
int | GC_get_int () |
Retrieve the integer value from the current element of the GenericContainer . | |
long | GC_get_long () |
Retrieve the long integer value from the current element of the GenericContainer . | |
double | GC_get_real () |
Retrieve the real number value from the current element of the GenericContainer . | |
c_complex_type | GC_get_complex () |
Retrieve the complex number from the current element of the GenericContainer . | |
double | GC_get_complex_re () |
Retrieve the real part of a complex number from the current element of the GenericContainer . | |
double | GC_get_complex_im () |
Retrieve the imaginary part of a complex number from the current element of the GenericContainer . | |
char const * | GC_get_string () |
Retrieve the string from the current element of the GenericContainer . | |
int | GC_push_bool (int a) |
Append a boolean value to the currently selected vector of booleans in the GenericContainer . | |
int | GC_push_int (int a) |
Append an integer value to the currently selected vector of integers in the GenericContainer . | |
int | GC_push_real (double a) |
Append a floating-point value to the currently selected vector of real numbers in the GenericContainer . | |
int | GC_push_complex (c_complex_type const *a) |
Append a complex number to the currently selected vector of complex numbers in the GenericContainer . | |
int | GC_push_complex2 (double re, double im) |
Append a complex number to the currently selected vector using real and imaginary parts. | |
int | GC_push_string (char const a[]) |
Append a string to the currently selected vector of strings in the GenericContainer . | |
int | GC_get_bool_at_pos (int pos) |
Retrieve a boolean value at a specified position from a vector of booleans in the GenericContainer . | |
int | GC_get_int_at_pos (int pos) |
Retrieve an integer value at a specified position from a vector of integers in the GenericContainer . | |
double | GC_get_real_at_pos (int pos) |
Retrieve a real number at a specified position from a vector of real numbers in the GenericContainer . | |
c_complex_type | GC_get_complex_at_pos (int pos) |
Retrieve a complex number at a specified position from a vector of complex numbers in the GenericContainer . | |
double | GC_get_complex_real_at_pos (int pos) |
Retrieve the real part of a complex number at a specified position from a vector of complex numbers. | |
double | GC_get_complex_imag_at_pos (int pos) |
Retrieve the imaginary part of a complex number at a specified position from a vector of complex numbers. | |
char const * | GC_get_string_at_pos (int pos) |
Retrieve a string at a specified position from a vector of strings in the GenericContainer . | |
double | GC_get_real_at_coor (int i, int j) |
Retrieve a real number at the specified row and column from a matrix of real numbers in the GenericContainer . | |
c_complex_type | GC_get_complex_at_coor (int i, int j) |
Retrieve a complex number at the specified row and column from a matrix of complex numbers. | |
double | GC_get_complex_real_at_coor (int i, int j) |
Retrieve the real part of a complex number at the specified row and column from a matrix. | |
double | GC_get_complex_imag_at_coor (int i, int j) |
Retrieve the imaginary part of a complex number at the specified row and column from a matrix. | |
int | GC_set_empty_vector_of_bool () |
Initialize the current element of the GenericContainer to an empty vector of booleans. | |
int | GC_set_empty_vector_of_int () |
Initialize the current element of the GenericContainer to an empty vector of integers. | |
int | GC_set_empty_vector_of_real () |
Initialize the current element of the GenericContainer to an empty vector of real numbers. | |
int | GC_set_empty_vector_of_complex () |
Initialize the current element of the GenericContainer to an empty vector of complex numbers. | |
int | GC_set_empty_vector_of_string () |
Initialize the current element of the GenericContainer to an empty vector of strings. | |
int | GC_set_vector_of_bool (int const *a, int nelem) |
Set the current element of the GenericContainer to a vector of booleans, and copy the provided values. | |
int | GC_set_vector_of_int (int const *a, int nelem) |
Set the current element of the GenericContainer to a vector of integers, and copy the provided values. | |
int | GC_set_vector_of_real (double const *a, int nelem) |
Set the current element of the GenericContainer to a vector of real numbers, and copy the provided values. | |
int | GC_set_vector_of_complex (double const *re, double const *im, int nelem) |
Set the current element of the GenericContainer to a vector of complex numbers, and copy the provided values. | |
int | GC_set_vector_of_string (char const **a, int nelem) |
Set the current element of the GenericContainer to a vector of strings, and copy the provided values. | |
int | GC_set_vector (int nelem) |
Set the current element of the GenericContainer to a vector of GenericContainer elements with the specified size. | |
int | GC_set_empty_vector () |
Set the current element of the GenericContainer to an empty vector of GenericContainer elements. | |
int | GC_get_vector_size () |
Retrieve the number of elements in the current vector of the GenericContainer . | |
int | GC_get_matrix_num_rows () |
Retrieve the number of rows in the current matrix of the GenericContainer . | |
int | GC_get_matrix_num_cols () |
Retrieve the number of columns in the current matrix of the GenericContainer . | |
int | GC_push_vector_position (int pos) |
Set the insertion point in the current vector of the GenericContainer . | |
int | GC_set_map () |
Initialize the current element of the GenericContainer to a map. | |
int | GC_init_map_key () |
Initialize the current element as a map key in the GenericContainer . | |
char const * | GC_get_next_key (void) |
Retrieve the key of the next element in a map from the GenericContainer . | |
int | GC_push_map_position (char const pos[]) |
Set the insertion point to the specified key in the current map of the GenericContainer . | |
This module provides the C interface for the GenericContainer class.
The GenericContainer (GC) module offers a flexible container for storing various data types such as booleans, integers, floating-point numbers, complex numbers, and strings. It also supports structured data types such as vectors and maps. The C interface allows for seamless interaction with the container, enabling users to perform operations like adding elements, retrieving data, and managing hierarchical structures.
Functionality includes:
Let's go through these steps in more detail.
GenericContainer
To start using a GenericContainer
, you need to initialize it using the GC_init()
function. Once initialized, the container is ready to store any supported data type.
GenericContainer
The GenericContainer
can store different types of data. Below are examples of how to set various types of data.
To store an integer, use the GC_set_int()
function.
To store a floating-point number, use GC_set_real()
:
You can store a string using the GC_set_string()
function:
If you want to store an array of integers, use the GC_set_vector_of_int()
function:
GenericContainer
Once data is stored in the GenericContainer
, you can retrieve it using the appropriate getter functions.
To retrieve elements from a vector, use GC_get_vector_size()
to get the size of the vector, and GC_get_int_at_pos()
to access individual elements.
The GenericContainer
also supports more complex structures like vectors of vectors or maps (key-value pairs). This allows you to represent hierarchical or complex data.
GenericContainer
You can create a vector of GenericContainer
objects, where each element may hold a different data type:
You can create a map where each key is associated with a value. For example, to map a string to another value:
At the end of the lifecycle of a GenericContainer
, it's important to release the memory using GC_clear()
:
Many GenericContainer
functions return an error code to help you detect and handle issues. For example, after setting an integer, check the return code:
Function | Description |
---|---|
GC_init(GenericContainer*) | Initializes a GenericContainer . |
GC_set_int(GenericContainer*, int) | Sets an integer in the container. |
GC_set_real(GenericContainer*, double) | Sets a floating-point number in the container. |
GC_set_string(GenericContainer*, const char*) | Sets a string in the container. |
GC_set_vector_of_int(GenericContainer*, const int*, int) | Sets an integer vector. |
GC_get_int(const GenericContainer*) | Retrieves an integer from the container. |
GC_get_real(const GenericContainer*) | Retrieves a floating-point number. |
GC_get_string(const GenericContainer*) | Retrieves a string. |
GC_clear(GenericContainer*) | Frees the memory used by the container. |
anonymous enum |
int GC_delete | ( | char const | id[] | ) |
Delete a GenericContainer object.
[in] | id | A string identifying the GenericContainer to delete. |
int GC_dump | ( | ) |
Dump the contents of the current GenericContainer.
int GC_fill_for_test | ( | char const | id[] | ) |
Fill a GenericContainer with test data.
[in] | id | A string identifying the GenericContainer. |
int GC_get_bool | ( | ) |
Retrieve the boolean value from the current element of the GenericContainer
.
This function returns the boolean value (stored as an integer) from the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
int GC_get_bool_at_pos | ( | int | pos | ) |
Retrieve a boolean value at a specified position from a vector of booleans in the GenericContainer
.
This function retrieves the boolean value (stored as an integer) at position pos
from a vector of booleans in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the value to be retrieved. |
c_complex_type GC_get_complex | ( | ) |
Retrieve the complex number from the current element of the GenericContainer
.
This function returns the complex number (as a c_complex_type
structure) from the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
c_complex_type
. c_complex_type GC_get_complex_at_coor | ( | int | i, |
int | j ) |
Retrieve a complex number at the specified row and column from a matrix of complex numbers.
This function retrieves the complex number (as a c_complex_type
structure) at the matrix coordinates (row i
, column j
) from a matrix of complex numbers in the currently selected element of the GenericContainer
. If the element is not a matrix or if the coordinates are out of range, an error code or unexpected value may be returned.
[in] | i | Row index of the value to be retrieved. |
[in] | j | Column index of the value to be retrieved. |
c_complex_type GC_get_complex_at_pos | ( | int | pos | ) |
Retrieve a complex number at a specified position from a vector of complex numbers in the GenericContainer
.
This function retrieves the complex number (as a c_complex_type
structure) at position pos
from a vector of complex numbers in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the value to be retrieved. |
double GC_get_complex_im | ( | ) |
Retrieve the imaginary part of a complex number from the current element of the GenericContainer
.
This function returns the imaginary part of a complex number stored in the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
double GC_get_complex_imag_at_coor | ( | int | i, |
int | j ) |
Retrieve the imaginary part of a complex number at the specified row and column from a matrix.
This function retrieves the imaginary part of a complex number at the matrix coordinates (row i
, column j
) from a matrix of complex numbers in the currently selected element of the GenericContainer
. If the element is not a matrix or if the coordinates are out of range, an error code or unexpected value may be returned.
[in] | i | Row index of the value to be retrieved. |
[in] | j | Column index of the value to be retrieved. |
double GC_get_complex_imag_at_pos | ( | int | pos | ) |
Retrieve the imaginary part of a complex number at a specified position from a vector of complex numbers.
This function retrieves the imaginary part of a complex number at position pos
from a vector of complex numbers in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the value to be retrieved. |
double GC_get_complex_re | ( | ) |
Retrieve the real part of a complex number from the current element of the GenericContainer
.
This function returns the real part of a complex number stored in the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
double GC_get_complex_real_at_coor | ( | int | i, |
int | j ) |
Retrieve the real part of a complex number at the specified row and column from a matrix.
This function retrieves the real part of a complex number at the matrix coordinates (row i
, column j
) from a matrix of complex numbers in the currently selected element of the GenericContainer
. If the element is not a matrix or if the coordinates are out of range, an error code or unexpected value may be returned.
[in] | i | Row index of the value to be retrieved. |
[in] | j | Column index of the value to be retrieved. |
double GC_get_complex_real_at_pos | ( | int | pos | ) |
Retrieve the real part of a complex number at a specified position from a vector of complex numbers.
This function retrieves the real part of a complex number at position pos
from a vector of complex numbers in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the value to be retrieved. |
int GC_get_int | ( | ) |
Retrieve the integer value from the current element of the GenericContainer
.
This function returns the integer value from the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
int GC_get_int_at_pos | ( | int | pos | ) |
Retrieve an integer value at a specified position from a vector of integers in the GenericContainer
.
This function retrieves the integer value at position pos
from a vector of integers in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the value to be retrieved. |
long GC_get_long | ( | ) |
Retrieve the long integer value from the current element of the GenericContainer
.
This function returns the long integer value from the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
int GC_get_matrix_num_cols | ( | ) |
Retrieve the number of columns in the current matrix of the GenericContainer
.
This function returns the number of columns in the currently selected matrix of the GenericContainer
. If the element is not a matrix, an error code or unexpected value may be returned.
int GC_get_matrix_num_rows | ( | ) |
Retrieve the number of rows in the current matrix of the GenericContainer
.
This function returns the number of rows in the currently selected matrix of the GenericContainer
. If the element is not a matrix, an error code or unexpected value may be returned.
char const * GC_get_next_key | ( | void | ) |
Retrieve the key of the next element in a map from the GenericContainer
.
This function returns the key of the next element in a map within the GenericContainer
. If the element is not a map or there are no more keys, an error code or unexpected value may be returned.
double GC_get_real | ( | ) |
Retrieve the real number value from the current element of the GenericContainer
.
This function returns the floating-point value from the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
double GC_get_real_at_coor | ( | int | i, |
int | j ) |
Retrieve a real number at the specified row and column from a matrix of real numbers in the GenericContainer
.
This function retrieves a floating-point value at the matrix coordinates (row i
, column j
) from a matrix of real numbers in the currently selected element of the GenericContainer
. If the element is not a matrix or if the coordinates are out of range, an error code or unexpected value may be returned.
[in] | i | Row index of the value to be retrieved. |
[in] | j | Column index of the value to be retrieved. |
double GC_get_real_at_pos | ( | int | pos | ) |
Retrieve a real number at a specified position from a vector of real numbers in the GenericContainer
.
This function retrieves the floating-point value at position pos
from a vector of real numbers in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the value to be retrieved. |
char const * GC_get_string | ( | ) |
Retrieve the string from the current element of the GenericContainer
.
This function returns the C-string stored in the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code or unexpected value may be returned.
char const * GC_get_string_at_pos | ( | int | pos | ) |
Retrieve a string at a specified position from a vector of strings in the GenericContainer
.
This function retrieves the C-string stored at position pos
from a vector of strings in the currently selected element of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code or unexpected value may be returned.
[in] | pos | Index position of the string to be retrieved. |
int GC_get_type | ( | ) |
Retrieve the type of the current element pointed by the head in the GenericContainer.
char const * GC_get_type_name | ( | ) |
Retrieve the name of the type of the current element in the GenericContainer.
int GC_get_vector_size | ( | ) |
Retrieve the number of elements in the current vector of the GenericContainer
.
This function returns the number of elements in the currently selected vector of the GenericContainer
. If the element is not a vector, an error code or unexpected value may be returned.
int GC_init_map_key | ( | ) |
Initialize the current element as a map key in the GenericContainer
.
This function sets the current element of the GenericContainer
as a key for a map. If the element is not of the correct type, an error code will be returned.
void * GC_mem_ptr | ( | char const | id[] | ) |
Get a pointer to the internal memory of the GenericContainer object.
[in] | id | A string identifying the GenericContainer. |
int GC_new | ( | char const | id[] | ) |
Create a new GenericContainer object.
[in] | id | A string identifying the new GenericContainer object. |
int GC_pop_head | ( | ) |
Move the head pointer up one level in the GenericContainer.
int GC_print_content_types | ( | ) |
Print the content types of the current GenericContainer.
int GC_push_bool | ( | int | a | ) |
Append a boolean value to the currently selected vector of booleans in the GenericContainer
.
This function pushes a boolean value (stored as an integer) to the end of the vector of booleans in the currently selected element of the GenericContainer
. If the element is not of the correct type or is not a vector, an error code will be returned.
[in] | a | Boolean value (stored as an integer) to be appended. |
int GC_push_complex | ( | c_complex_type const * | a | ) |
Append a complex number to the currently selected vector of complex numbers in the GenericContainer
.
This function pushes a complex number a
to the end of the vector of complex numbers in the currently selected element of the GenericContainer
. If the element is not of the correct type or is not a vector, an error code will be returned.
[in] | a | Pointer to a c_complex_type structure containing the complex number. |
int GC_push_complex2 | ( | double | re, |
double | im ) |
Append a complex number to the currently selected vector using real and imaginary parts.
This function pushes a complex number, specified by its real (re
) and imaginary (im
) parts, to the end of the vector of complex numbers in the currently selected element of the GenericContainer
. If the element is not of the correct type or is not a vector, an error code will be returned.
[in] | re | Real part of the complex number. |
[in] | im | Imaginary part of the complex number. |
int GC_push_int | ( | int | a | ) |
Append an integer value to the currently selected vector of integers in the GenericContainer
.
This function pushes an integer value a
to the end of the vector of integers in the currently selected element of the GenericContainer
. If the element is not of the correct type or is not a vector, an error code will be returned.
[in] | a | Integer value to be appended. |
int GC_push_map_position | ( | char const | pos[] | ) |
Set the insertion point to the specified key in the current map of the GenericContainer
.
This function sets the insertion point to the map element associated with the specified key pos
. If the element is not a map or the key does not exist, an error code will be returned.
[in] | pos | C-string representing the key. |
int GC_push_real | ( | double | a | ) |
Append a floating-point value to the currently selected vector of real numbers in the GenericContainer
.
This function pushes a real number a
(double precision) to the end of the vector of real numbers in the currently selected element of the GenericContainer
. If the element is not of the correct type or is not a vector, an error code will be returned.
[in] | a | Real number (double precision) to be appended. |
int GC_push_string | ( | char const | a[] | ) |
Append a string to the currently selected vector of strings in the GenericContainer
.
This function pushes a string a
to the end of the vector of strings in the currently selected element of the GenericContainer
. If the element is not of the correct type or is not a vector, an error code will be returned.
[in] | a | C-string (null-terminated) to be appended. |
int GC_push_vector_position | ( | int | pos | ) |
Set the insertion point in the current vector of the GenericContainer
.
This function sets the insertion point to the element at position pos
in the currently selected vector of the GenericContainer
. If the element is not a vector or if pos
is out of range, an error code will be returned.
[in] | pos | Index position where the insertion point is set. |
int GC_reset_head | ( | ) |
Reset the head pointer to the first level in the GenericContainer.
int GC_select | ( | char const | id[] | ) |
Select an existing GenericContainer object.
[in] | id | A string identifying the GenericContainer to select. |
int GC_set_bool | ( | int | a | ) |
Set actual pointed element of GenericContainer
to bool
with value a
[in] | a | boolean to be stored |
int GC_set_complex | ( | c_complex_type const * | a | ) |
Set the current element of the GenericContainer
to a complex number.
This function stores a complex number represented by the structure c_complex_type
in the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code will be returned.
[in] | a | Pointer to a c_complex_type structure containing the real and imaginary parts of the complex number. |
int GC_set_complex2 | ( | double | re, |
double | im ) |
Set the current element of the GenericContainer
to a complex number using real and imaginary parts.
This function stores a complex number directly using its real (re
) and imaginary (im
) parts in the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code will be returned.
[in] | re | Real part of the complex number. |
[in] | im | Imaginary part of the complex number. |
int GC_set_empty_vector | ( | ) |
Set the current element of the GenericContainer
to an empty vector of GenericContainer
elements.
This function initializes the currently selected element of the GenericContainer
to an empty vector of GenericContainer
elements.
int GC_set_empty_vector_of_bool | ( | ) |
Initialize the current element of the GenericContainer
to an empty vector of booleans.
This function sets the currently selected element of the GenericContainer
to an empty vector of booleans (size 0).
int GC_set_empty_vector_of_complex | ( | ) |
Initialize the current element of the GenericContainer
to an empty vector of complex numbers.
This function sets the currently selected element of the GenericContainer
to an empty vector of complex numbers (size 0).
int GC_set_empty_vector_of_int | ( | ) |
Initialize the current element of the GenericContainer
to an empty vector of integers.
This function sets the currently selected element of the GenericContainer
to an empty vector of integers (size 0).
int GC_set_empty_vector_of_real | ( | ) |
Initialize the current element of the GenericContainer
to an empty vector of real numbers.
This function sets the currently selected element of the GenericContainer
to an empty vector of real numbers (size 0).
int GC_set_empty_vector_of_string | ( | ) |
Initialize the current element of the GenericContainer
to an empty vector of strings.
This function sets the currently selected element of the GenericContainer
to an empty vector of strings (size 0).
int GC_set_int | ( | int | a | ) |
Set the current element of the GenericContainer
to an integer value.
This function assigns the integer value a
to the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code will be returned.
[in] | a | Integer value to be stored. |
int GC_set_map | ( | ) |
Initialize the current element of the GenericContainer
to a map.
This function sets the currently selected element of the GenericContainer
to an empty map. If the element is not of the correct type, an error code will be returned.
int GC_set_real | ( | double | a | ) |
Set the current element of the GenericContainer
to a real number.
This function assigns the double-precision floating-point value a
to the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code will be returned.
[in] | a | Double value (real number) to be stored. |
int GC_set_string | ( | char const | a[] | ) |
Set the current element of the GenericContainer
to a string.
This function stores a string a
in the currently selected element of the GenericContainer
. If the element is not of the correct type, an error code will be returned.
[in] | a | C-string to be stored (null-terminated). |
int GC_set_vector | ( | int | nelem | ) |
Set the current element of the GenericContainer
to a vector of GenericContainer
elements with the specified size.
This function initializes the currently selected element of the GenericContainer
to a vector of GenericContainer
elements, with nelem
elements. The insertion point is set to the first element.
[in] | nelem | Number of GenericContainer elements to be created. |
int GC_set_vector_of_bool | ( | int const * | a, |
int | nelem ) |
Set the current element of the GenericContainer
to a vector of booleans, and copy the provided values.
This function sets the currently selected element of the GenericContainer
to a vector of booleans with nelem
elements, copying the boolean values from the provided array a
.
[in] | a | Array of boolean values (stored as integers) to be copied. |
[in] | nelem | Number of elements in the array a . |
int GC_set_vector_of_complex | ( | double const * | re, |
double const * | im, | ||
int | nelem ) |
Set the current element of the GenericContainer
to a vector of complex numbers, and copy the provided values.
This function sets the currently selected element of the GenericContainer
to a vector of complex numbers with nelem
elements, copying the real and imaginary parts of each complex number from the provided arrays re
and im
.
[in] | re | Array of real parts of complex numbers to be copied. |
[in] | im | Array of imaginary parts of complex numbers to be copied. |
[in] | nelem | Number of elements in the arrays re and im . |
int GC_set_vector_of_int | ( | int const * | a, |
int | nelem ) |
Set the current element of the GenericContainer
to a vector of integers, and copy the provided values.
This function sets the currently selected element of the GenericContainer
to a vector of integers with nelem
elements, copying the integer values from the provided array a
.
[in] | a | Array of integer values to be copied. |
[in] | nelem | Number of elements in the array a . |
int GC_set_vector_of_real | ( | double const * | a, |
int | nelem ) |
Set the current element of the GenericContainer
to a vector of real numbers, and copy the provided values.
This function sets the currently selected element of the GenericContainer
to a vector of real numbers (double
) with nelem
elements, copying the values from the provided array a
.
[in] | a | Array of floating-point values to be copied. |
[in] | nelem | Number of elements in the array a . |
int GC_set_vector_of_string | ( | char const ** | a, |
int | nelem ) |
Set the current element of the GenericContainer
to a vector of strings, and copy the provided values.
This function sets the currently selected element of the GenericContainer
to a vector of strings with nelem
elements, copying the strings from the provided array a
.
[in] | a | Array of C-strings (null-terminated) to be copied. |
[in] | nelem | Number of elements in the array a . |