|
YAC 3.21.0
Yet Another Coupler
|
#include "parameter/param.h"

Go to the source code of this file.
Typedefs | |
| typedef int(* | yac_param_oneof_factory_ptr) (const char *name, void **obj, struct yac_param **param, int *is_default) |
| Function pointer type for creating a default subparameter and associated object for a oneof parameter. | |
Functions | |
| struct yac_param * | yac_param_oneof_new (const char *name, yac_param_oneof_factory_ptr default_factory, void **obj, struct yac_param *subparam, int subparam_is_default) |
| Create a new one-of struct parameter with a given name and a default_factory. | |
| typedef int(* yac_param_oneof_factory_ptr) (const char *name, void **obj, struct yac_param **param, int *is_default) |
Function pointer type for creating a default subparameter and associated object for a oneof parameter.
The function must allocate and return both a new object (void*) and its associated yac_param pointer. The object is the user data, the parameter is the config param object for that subparameter.
| name | Name of the subparameter to create. If NULL, the factory must create the default selection. | |
| [out] | obj | Pointer to the new object (void*) |
| [out] | param | Pointer to the new yac_param* |
| [out] | is_default | Flag (int) indicating if this is the default subparameter |
Definition at line 27 of file param_oneof.h.
| struct yac_param * yac_param_oneof_new | ( | const char * | name, |
| yac_param_oneof_factory_ptr | default_factory, | ||
| void ** | obj, | ||
| struct yac_param * | subparam, | ||
| int | subparam_is_default ) |
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.
| 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. |
Definition at line 145 of file param_oneof.c.
