A tree configuration is a position on the tree (see tree.h) of a tree space (see tree_space.h).
More...
Go to the source code of this file.
|
| ccs_result_t | ccs_create_tree_configuration (ccs_tree_space_t tree_space, ccs_features_t features, size_t position_size, const size_t *position, ccs_tree_configuration_t *configuration_ret) |
| | Create a new instance of a tree configuration on a given tree_space.
|
| |
| ccs_result_t | ccs_tree_configuration_get_tree_space (ccs_tree_configuration_t configuration, ccs_tree_space_t *tree_space_ret) |
| | Get the tree space associated to the configuration.
|
| |
| ccs_result_t | ccs_tree_configuration_get_features (ccs_tree_configuration_t configuration, ccs_features_t *features_ret) |
| | Get the associated features.
|
| |
| ccs_result_t | ccs_tree_configuration_get_position (ccs_tree_configuration_t configuration, size_t position_size, size_t *position, size_t *position_size_ret) |
| | Get the position of the configuration.
|
| |
| ccs_result_t | ccs_tree_configuration_get_values (ccs_tree_configuration_t configuration, size_t num_values, ccs_datum_t *values, size_t *num_values_ret) |
| | Get the values along the path of the configuration.
|
| |
| ccs_result_t | ccs_tree_configuration_get_node (ccs_tree_configuration_t configuration, ccs_tree_t *node_ret) |
| | Get the node pointed to by the configuration.
|
| |
| ccs_result_t | ccs_tree_configuration_hash (ccs_tree_configuration_t configuration, ccs_hash_t *hash_ret) |
| | Compute a hash value for the configuration by hashing together the tree space reference, the position size and the position values.
|
| |
| ccs_result_t | ccs_tree_configuration_cmp (ccs_tree_configuration_t configuration, ccs_tree_configuration_t other_configuration, int *cmp_ret) |
| | Define a strict ordering of tree configuration instances.
|
| |
A tree configuration is a position on the tree (see tree.h) of a tree space (see tree_space.h).
◆ ccs_create_tree_configuration()
Create a new instance of a tree configuration on a given tree_space.
An empty position targets the root of the tree.
- Parameters
-
| [in] | tree_space | |
| [in] | features | an optional features to use. If NULL and a feature space was provided at configuration_space creation, the default features of the feature space will be used. |
| [in] | position_size | the number of entries in the position array |
| [in] | position | an array of indexes defining a location in the tree. can be NULL if position_size is 0 |
| [out] | configuration_ret | a pointer to the variable that will hold the newly created tree configuration |
- Returns
- CCS_RESULT_SUCCESS on success
-
CCS_RESULT_ERROR_INVALID_OBJECT if
tree space is not a valid CCS tree space; or if features is not NULL and is not a valid CCS features
-
CCS_RESULT_ERROR_INVALID_FEATURES if features feature space is not the same as the feature space provided at
tree_space creation.
-
CCS_RESULT_ERROR_INVALID_VALUE if
configuration_ret is NULL; or if position is NULL and position_size is greater than 0; or if position does not describe a valid position in the tree space
-
CCS_RESULT_ERROR_OUT_OF_MEMORY if there was a lack of memory to allocate the new tree configuration
◆ ccs_tree_configuration_cmp()
Define a strict ordering of tree configuration instances.
Tree space, size of position and position values are compared.
- Parameters
-
| [in] | configuration | the first configuration |
| [in] | other_configuration | the second configuration |
| [out] | cmp_ret | the pointer to the variable that will contain the result of the comparison. Will contain -1, 0, or 1 depending on if the first configuration is found to be respectively lesser than, equal, or greater then the second configuration |
- Returns
- CCS_RESULT_SUCCESS on success
-
CCS_RESULT_ERROR_INVALID_OBJECT if
configuration or other_configuration are not a valid CCS tree configurations
◆ ccs_tree_configuration_get_features()
◆ ccs_tree_configuration_get_node()
◆ ccs_tree_configuration_get_position()
Get the position of the configuration.
- Parameters
-
| [in] | configuration | |
| [in] | position_size | the size of the position array |
| [out] | position | an array of size position_size to hold the returned values, or NULL. If the array is too big, extra values are set to 0 |
| [out] | position_size_ret | a pointer to a variable that will contain the number of values that are or would be returned. Can be NULL |
- Returns
- CCS_RESULT_SUCCESS on success
-
CCS_RESULT_ERROR_INVALID_OBJECT if
configuration is not a valid CCS tree configuration
-
CCS_RESULT_ERROR_INVALID_VALUE if
position is NULL and position_size is greater than 0; or if position is NULL and position_size_ret is NULL; or if position_size is less than the number of values that would be returned
◆ ccs_tree_configuration_get_tree_space()
◆ ccs_tree_configuration_get_values()
Get the values along the path of the configuration.
- Parameters
-
| [in] | configuration | |
| [in] | num_values | the size of the values array |
| [out] | values | an array of size num_values to hold the returned values, or NULL. If the array is too big, extra values are set to CCS_DATA_TYPE_NONE |
| [out] | num_values_ret | a pointer to a variable that will contain the number of values that are or would be returned. Can be NULL |
- Returns
- CCS_RESULT_SUCCESS on success
-
CCS_RESULT_ERROR_INVALID_OBJECT if
configuration is not a valid CCS tree configuration
-
CCS_RESULT_ERROR_INVALID_VALUE if
values is NULL and num_values is greater than 0; or if values is NULL and num_values_ret is NULL; or if num_values is less than the number of values that would be returned
◆ ccs_tree_configuration_hash()
Compute a hash value for the configuration by hashing together the tree space reference, the position size and the position values.
- Parameters
-
| [in] | configuration | |
| [out] | hash_ret | the address of the variable that will contain the hash value |
- Returns
- CCS_RESULT_SUCCESS on success
-
CCS_RESULT_ERROR_INVALID_OBJECT if
configuration is not a valid CCS tree configuration
-
CCS_RESULT_ERROR_INVALID_VALUE if
hash_ret is NULL