|
Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
A datatype to tell the system that certain parameters should be grouped together in the client's user interface if possible. More...
#include <parameter_group.h>
Public Member Functions | |
| bool | GetParameterGroupVisibility (const struct ServiceData *service_data_p, const char *group_name_s, bool *visibility_p) |
| Get the configured visibility value for a given ParameterGroup. More... | |
| ParameterGroup * | AllocateParameterGroup (const char *name_s, const bool repeatable_flag, const struct ServiceData *service_data_p) |
| Allocate a ParameterGroup. More... | |
| void | FreeParameterGroup (ParameterGroup *param_group_p) |
| Free a given ParameterGroup. More... | |
| bool | AddParameterGroupAsJSON (ParameterGroup *param_group_p, json_t *groups_array_p, const SchemaVersion *const sv_p) |
| Add the JSON fragment detailing a given ParameterGroup to a given JSON array. More... | |
| json_t * | GetParameterGroupAsJSON (const ParameterGroup *param_group_p, const bool include_params_flag, const bool full_definition_flag, const SchemaVersion *const sv_p) |
| Get the JSON fragment detailing a given ParameterGroup. More... | |
| bool | AddParameterGroupChild (ParameterGroup *parent_group_p, ParameterGroup *child_group_p) |
| Add a ParameterGroup as a child to another ParameterGroup. More... | |
| ParameterGroup * | CreateAndAddParameterGroupChild (ParameterGroup *parent_group_p, const char *name_s, const bool repeatable_flag, const bool add_params_flag) |
| Create and add a ParameterGroup as a child to another ParameterGroup. More... | |
| bool | RemoveParameterGroupChild (ParameterGroup *parent_group_p, ParameterGroup *child_group_p) |
| Remove a ParameterGroup child from another ParameterGroup. More... | |
| bool | CloneParameters (const ParameterGroup *const src_group_p, ParameterGroup *dest_group_p) |
| Clone all of the Parameters from one ParameterGroup to another. More... | |
| bool | AddParameterToParameterGroup (ParameterGroup *parent_group_p, Parameter *param_p) |
| Add a Parameter to a ParameterGroup. More... | |
| ParameterGroup * | CreateAndAddParameterGroupToParameterSet (const char *name_s, const bool repeatable_flag, const struct ServiceData *service_data_p, struct ParameterSet *param_set_p) |
| Create a ParameterGroup and add it to a given ParameterSet. More... | |
| ParameterNode * | GetParameterNodeFromParameterGroupByName (const ParameterGroup *const group_p, const char *const name_s) |
| Get the ParameterNode for a Parameter with a given name from a ParameterGroup. More... | |
| Parameter * | GetParameterFromParameterGroupByName (const ParameterGroup *const group_p, const char *const name_s) |
| Get the Parameter with a given name from a ParameterGroup. More... | |
| char * | GetRepeatableParameterGroupName (ParameterGroup *const group_p) |
| Get the name to use for a child of a repeatable ParameterGroup. More... | |
| char * | GetRepeatableParameterGroupRegularExpression (const ParameterGroup *const group_p) |
| Get the string to use for matching ParameterGroups as children of a repeatable ParameterGroup. More... | |
| bool | AddRepeatableParameterGroupLabelParam (ParameterGroup *group_p, Parameter *param_p) |
| Add a Parameter to those used for labelling entries in a repeated ParameterGroup. More... | |
| bool | ReplaceParameterInParameterGroup (ParameterGroup *params_p, Parameter *old_param_p, Parameter *new_param_p) |
| Replace a Parameter in a ParameterGroup. More... | |
Data Fields | |
| char * | pg_name_s |
| The name of the ParameterGroup. More... | |
| bool | pg_visible_flag |
| Should this ParameterGroup initially be visible? More... | |
| bool | pg_full_display_flag |
| Should this ParameterGroup have a full display e.g. More... | |
| bool | pg_vertical_layout_flag |
| Should the ParameterGroup layout its child parameters horizontally or vertically? More... | |
| bool | pg_repeatable_flag |
Can the parameters in this group be repeated, analogous to a row in a table, false if not. More... | |
| LinkedList * | pg_repeatable_label_params_p |
| If the ParameterGroup is repeatable, use these named parameters as the label in the list of the parameters for this ParameterGroup. More... | |
| uint32 | pg_current_repeatable_group_index |
| If the parameters can be repeated, this is the current index e.g. More... | |
| LinkedList * | pg_params_p |
| A list of ParameterNodes for the parameters in this group. More... | |
| LinkedList * | pg_child_groups_p |
| A list of ParmameterGroupNodes for any child parameter groups. More... | |
| const struct ServiceData * | pg_service_data_p |
| The ServiceData for the Service that has created this ParametetrGroup. More... | |
A datatype to tell the system that certain parameters should be grouped together in the client's user interface if possible.
| bool GetParameterGroupVisibility | ( | const struct ServiceData * | service_data_p, |
| const char * | group_name_s, | ||
| bool * | visibility_p | ||
| ) |
Get the configured visibility value for a given ParameterGroup.
| service_data_p | The ServiceData for the Service that the given ParameterGroup belongs to. |
| group_name_s | The name of the ParameterGroup to check. |
| visibility_p | Pointer to where the value for configured visibility value for the given ParameterGroup will be stored. |
true if the visibility flag was set successfully, false otherwise. | ParameterGroup * AllocateParameterGroup | ( | const char * | name_s, |
| const bool | repeatable_flag, | ||
| const struct ServiceData * | service_data_p | ||
| ) |
Allocate a ParameterGroup.
| name_s | The name of the ParameterGroup that will be displayed to the user. |
| key_s | An optional internal key to use by the owning Service. This can be NULL. |
| service_data_p | The ServiceData for the Service that generates this ParameterGroup. |
| repeatable_flag | true if the parameters in this group can be repeated, analogous to a row in a table, false if not. |
NULL upon error. | void FreeParameterGroup | ( | ParameterGroup * | param_group_p | ) |
Free a given ParameterGroup.
| param_group_p | The ParameterGroup to free. |
| bool AddParameterGroupAsJSON | ( | ParameterGroup * | param_group_p, |
| json_t * | groups_array_p, | ||
| const SchemaVersion *const | sv_p | ||
| ) |
Add the JSON fragment detailing a given ParameterGroup to a given JSON array.
| param_group_p | The ParameterGroup to get the JSON for. |
| groups_array_p | The JSON array to add the JSON representation of the ParameterGroup to. |
true if the ParameterGroup was added successfully, false otherwise. | json_t * GetParameterGroupAsJSON | ( | const ParameterGroup * | param_group_p, |
| const bool | include_params_flag, | ||
| const bool | full_definition_flag, | ||
| const SchemaVersion *const | sv_p | ||
| ) |
Get the JSON fragment detailing a given ParameterGroup.
| param_group_p | The ParameterGroup to get the JSON for. |
NULL upon error. | bool AddParameterGroupChild | ( | ParameterGroup * | parent_group_p, |
| ParameterGroup * | child_group_p | ||
| ) |
Add a ParameterGroup as a child to another ParameterGroup.
| parent_group_p | The ParameterGroup to add the child ParameterGroup to. |
| child_group_p | The ParameterGroup to add. |
true if the ParameterGroup was added successfully, false otherwise. | ParameterGroup * CreateAndAddParameterGroupChild | ( | ParameterGroup * | parent_group_p, |
| const char * | name_s, | ||
| const bool | repeatable_flag, | ||
| const bool | add_params_flag | ||
| ) |
Create and add a ParameterGroup as a child to another ParameterGroup.
| parent_group_p | The ParameterGroup to create and add the child ParameterGroup to. |
| name_s | The name of the ParameterGroup that will be displayed to the user. |
| repeatable_flag | true if the parameters in this group can be repeated, analogous to a row in a table, false if not. |
| add_params_flag | If this is true then all of the Parameters in parent_group_p will be cloned into this newly-created ParameterGroup using ClonedParameters(). If this is false then the Parameters will not be copied. |
NULL if there was an error. | bool RemoveParameterGroupChild | ( | ParameterGroup * | parent_group_p, |
| ParameterGroup * | child_group_p | ||
| ) |
Remove a ParameterGroup child from another ParameterGroup.
| parent_group_p | The ParameterGroup to remove the child ParameterGroup from. |
| child_group_p | The ParameterGroup to remove. |
true if the ParameterGroup was removed successfully, false otherwise. | bool CloneParameters | ( | const ParameterGroup *const | src_group_p, |
| ParameterGroup * | dest_group_p | ||
| ) |
Clone all of the Parameters from one ParameterGroup to another.
| src_group_p | The ParameterGroup to clone the Parameters from |
| dest_group_p | The ParameterGroup to add the cloned Parameters to. |
true if all of the Parameters were cloned successfully, false otherwise. | bool AddParameterToParameterGroup | ( | ParameterGroup * | parent_group_p, |
| Parameter * | param_p | ||
| ) |
Add a Parameter to a ParameterGroup.
| parent_group_p | The ParameterGroup to add the Parameter to. |
| param_p | The Parameter to add. |
true if the Parameter was added successfully, false otherwise. | ParameterGroup * CreateAndAddParameterGroupToParameterSet | ( | const char * | name_s, |
| const bool | repeatable_flag, | ||
| const struct ServiceData * | service_data_p, | ||
| struct ParameterSet * | param_set_p | ||
| ) |
Create a ParameterGroup and add it to a given ParameterSet.
| name_s | The name of the ParameterGroup that will be displayed to the user. |
| repeatable_flag | true if the parameters in this group can be repeated, analogous to a row in a table, false if not. |
| service_data_p | The ServiceData for the Service that generates this ParameterGroup. |
| param_set_p | The ParameterSet to add the ParameterGroup to. |
NULL upon error. | ParameterNode * GetParameterNodeFromParameterGroupByName | ( | const ParameterGroup *const | group_p, |
| const char *const | name_s | ||
| ) |
Get the ParameterNode for a Parameter with a given name from a ParameterGroup.
| group_p | The ParameterGroup to search. |
| name_s | The Parameter name to try and match. |
NULL if it could not be found | Parameter * GetParameterFromParameterGroupByName | ( | const ParameterGroup *const | group_p, |
| const char *const | name_s | ||
| ) |
Get the Parameter with a given name from a ParameterGroup.
| group_p | The ParameterGroup to search. |
| name_s | The Parameter name to try and match. |
NULL if it could not be found | char * GetRepeatableParameterGroupName | ( | ParameterGroup *const | group_p | ) |
Get the name to use for a child of a repeatable ParameterGroup.
| group_p | The ParameterSet to get the name from. |
NULL if there was an error. | char * GetRepeatableParameterGroupRegularExpression | ( | const ParameterGroup *const | group_p | ) |
Get the string to use for matching ParameterGroups as children of a repeatable ParameterGroup.
| group_p | The ParameterGroup to get the regular expresion string from. |
NULL if there was an error. This value will need to be freed using FreeCopiedString() to avoid a memory leak. | bool AddRepeatableParameterGroupLabelParam | ( | ParameterGroup * | group_p, |
| Parameter * | param_p | ||
| ) |
Add a Parameter to those used for labelling entries in a repeated ParameterGroup.
| group_p | The ParameterGroup that the label will be amended for |
| param_p | The Parameter to use for the label |
true if the ParameterGroup label was updated successfully, false otherwise. | bool ReplaceParameterInParameterGroup | ( | ParameterGroup * | params_p, |
| Parameter * | old_param_p, | ||
| Parameter * | new_param_p | ||
| ) |
Replace a Parameter in a ParameterGroup.
| params_p | The ParameterGroup to amend. |
| old_param_p | The Parameter to remove. |
| new_param_p | The Parameter to add to the ParameterGroup. |
true if the Parameter was replaced successfully, false otherwise. | char* pg_name_s |
The name of the ParameterGroup.
| bool pg_visible_flag |
Should this ParameterGroup initially be visible?
| bool pg_full_display_flag |
Should this ParameterGroup have a full display e.g.
a titled legend or simply be a minimal grouping
| bool pg_vertical_layout_flag |
Should the ParameterGroup layout its child parameters horizontally or vertically?
| bool pg_repeatable_flag |
Can the parameters in this group be repeated, analogous to a row in a table, false if not.
| LinkedList* pg_repeatable_label_params_p |
If the ParameterGroup is repeatable, use these named parameters as the label in the list of the parameters for this ParameterGroup.
| uint32 pg_current_repeatable_group_index |
If the parameters can be repeated, this is the current index e.g.
row number in a table.
| LinkedList* pg_params_p |
A list of ParameterNodes for the parameters in this group.
| LinkedList* pg_child_groups_p |
A list of ParmameterGroupNodes for any child parameter groups.
| const struct ServiceData* pg_service_data_p |
The ServiceData for the Service that has created this ParametetrGroup.