|
C Configuration Space and Tuning Library (CCS)
|
A Context is a collection of parameters defining a value space. More...

Go to the source code of this file.
Functions | |
| ccs_result_t | ccs_context_get_name (ccs_context_t context, const char **name_ret) |
| Get the name of a context. | |
| ccs_result_t | ccs_context_get_parameter (ccs_context_t context, size_t index, ccs_parameter_t *parameter_ret) |
| Get an parameter in a context given its index. | |
| ccs_result_t | ccs_context_get_parameters (ccs_context_t context, size_t num_parameters, ccs_parameter_t *parameters, size_t *num_parameters_ret) |
| Get the parameters in the given context. | |
| ccs_result_t | ccs_context_get_parameter_by_name (ccs_context_t context, const char *name, ccs_parameter_t *parameter_ret) |
| Get an parameter in a context given its name. | |
| ccs_result_t | ccs_context_get_parameter_index_by_name (ccs_context_t context, const char *name, ccs_bool_t *found_ret, size_t *index_ret) |
| Get the index of an parameter in the context given its name. | |
| ccs_result_t | ccs_context_get_parameter_index (ccs_context_t context, ccs_parameter_t parameter, ccs_bool_t *found_ret, size_t *index_ret) |
| Get the index of an parameter in the context. | |
| ccs_result_t | ccs_context_get_parameter_indexes (ccs_context_t context, size_t num_parameters, ccs_parameter_t *parameters, ccs_bool_t *found, size_t *indexes) |
| Get the indices of a set of parameters in a context. | |
| ccs_result_t | ccs_context_validate_value (ccs_context_t context, size_t index, ccs_datum_t value, ccs_datum_t *value_ret) |
| Validate that a given value at the given index is valid in the context, and return a sanitized value. | |
A Context is a collection of parameters defining a value space.
Each parameter has a specific index that can be used to reference it. The methods defined in this file can be used on objects who are contexts. In practice those are useful for binding to avoid binding the children methods, whereas a C application would rather use the object class specific versions in order to benefit from the added type safety.
|
extern |
Get the name of a context.
| [in] | context | |
| [out] | name_ret | a pointer to a char * variable which will contain a pointer to the context name. |
context is not a valid CCS object name_ret is NULL
|
extern |
Get an parameter in a context given its index.
| [in] | context | |
| [in] | index | the index of the parameter to retrieve |
| [out] | parameter_ret | a pointer to the variable that will contain the parameter |
context is not a valid CCS object parameter_ret is NULL index is greater than the count of parameters in the context
|
extern |
Get an parameter in a context given its name.
| [in] | context | |
| [in] | name | the name of the parameter to retrieve |
| [out] | parameter_ret | a pointer to the variable that will contain the parameter, or NULL if the parameter is not found in the context |
context is not a valid CCS object name or parameter_ret are NULL
|
extern |
Get the index of an parameter in the context.
| [in] | context | |
| [in] | parameter | |
| [out] | found_ret | a pointer to the an optional variable that will hold whether the parameter was found in the context |
| [out] | index_ret | a pointer to the variable which will contain the index of the parameter |
context is not a valid CCS object; index_ret is NULL found_ret is NULL and context does not contain parameter
|
extern |
Get the index of an parameter in the context given its name.
| [in] | context | |
| [in] | name | the name of the parameter to retrieve the index of |
| [out] | found_ret | a pointer to the an optional variable that will hold whether a parameter named name was found in context |
| [out] | index_ret | a pointer to the variable that will contain the index of parameter in the context |
context is not a valid CCS object name or index_ret are NULL found_ret is NULL and no parameter with such name exist in the context
|
extern |
Get the indices of a set of parameters in a context.
| [in] | context | |
| [in] | num_parameters | the number of parameters to query the index for |
| [in] | parameters | an array of num_parameters parameters to query the index for |
| [out] | found | an optional array of num_parameters variables that will hold whether the parameter was found in context |
| [out] | indexes | an array of num_parameters indices that will contain the values of the parameter indices |
context is not a valid CCS object parameters is NULL and num_parameters is greater than 0; or if indexes is NULL and num_parameters is greater than 0 found_ret is NULL and at least one of the parameters is not contained in context
|
extern |
Get the parameters in the given context.
| [in] | context | |
| [in] | num_parameters | is the number of parameters that can be added to parameters. If parameters is not NULL num_parameters must be greater than 0 |
| [in] | parameters | an array of num_parameters that will contain the returned parameters or NULL. If the array is too big, extra values are set to NULL |
| [out] | num_parameters_ret | a pointer to a variable that will contain the number of parameters that are or would be returned. Can be NULL |
context is not a valid CCS object parameters is NULL and num_parameters is greater than 0; or if parameters is NULL and num_parameters_ret is NULL; or if num_parameters is less than the number of parameters that would be returned
|
extern |
Validate that a given value at the given index is valid in the context, and return a sanitized value.
| [in] | context | |
| [in] | index | the index of the value in the context |
| [in] | value | the datum to validate |
| [out] | value_ret | a pointer that will contain the validated value. If value is a string value_ret will contain a non transient string. |
context is not a valid CCS object context