#include "param_oneof.h"
#include "param_internal.h"
#include "utils_common.h"
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
◆ yac_param_oneof_delete()
| static void yac_param_oneof_delete |
( |
struct yac_param * | param | ) |
|
|
static |
◆ yac_param_oneof_get_name()
| static const char * yac_param_oneof_get_name |
( |
const struct yac_param * | param | ) |
|
|
static |
◆ yac_param_oneof_get_sub_by_index()
| static int yac_param_oneof_get_sub_by_index |
( |
struct yac_param * | param, |
|
|
size_t | idx, |
|
|
struct yac_param ** | sub_param ) |
|
static |
◆ yac_param_oneof_get_sub_by_name()
| static int yac_param_oneof_get_sub_by_name |
( |
const struct yac_param * | param, |
|
|
const char * | name, |
|
|
struct yac_param ** | sub_param ) |
|
static |
◆ yac_param_oneof_get_sub_count()
| static int yac_param_oneof_get_sub_count |
( |
const struct yac_param * | param, |
|
|
size_t * | count ) |
|
static |
◆ yac_param_oneof_get_type()
◆ yac_param_oneof_is_default()
| static int yac_param_oneof_is_default |
( |
const struct yac_param * | param | ) |
|
|
static |
◆ yac_param_oneof_new()
Create a new one-of struct parameter with a given name and a default_factory.
TODO: fix description The factory is used to create the initial (default) subparameter and its associated object. The pointer to the created object is returned via the obj argument. The caller may pre-set *obj to provide context to the factory.
- Parameters
-
| name | Name of the struct parameter (must not be NULL or empty) |
| default_factory | Function pointer to create the default subparameter and object (must not be NULL) |
| obj | Pointer to the oneof object pointer. If *obj is NULL, the active subparameter is created lazily via default_factory. If *obj is non-NULL, the oneof is considered already defined. |
| subparam | Optional already-created active subparameter. Must be NULL if *obj is NULL. Ownership is transferred to the returned oneof parameter. |
| subparam_is_default | Non-zero if the predefined subparam represents the default choice of the oneof. Only evaluated when *obj is non-NULL (i.e. a predefined subparam is provided); ignored otherwise. |
- Returns
- Pointer to new one-of struct parameter object
Definition at line 145 of file param_oneof.c.
◆ yac_param_oneof_vtable
Initial value:= {
.append = NULL,
.set_scalar = NULL,
.get_scalar = NULL,
.get_scalar_kind = NULL,
.set_scalar_int = NULL,
.set_scalar_dble = NULL,
.get_scalar_int = NULL,
.get_scalar_dble = NULL
}
static void yac_param_oneof_delete(struct yac_param *param)
static int yac_param_oneof_get_sub_count(const struct yac_param *param, size_t *count)
static int yac_param_oneof_get_sub_by_name(const struct yac_param *param, const char *name, struct yac_param **sub_param)
static int yac_param_oneof_get_sub_by_index(struct yac_param *param, size_t idx, struct yac_param **sub_param)
static const char * yac_param_oneof_get_name(const struct yac_param *param)
static enum yac_param_type yac_param_oneof_get_type(const struct yac_param *param)
static int yac_param_oneof_is_default(const struct yac_param *param)
Definition at line 127 of file param_oneof.c.