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.
ParameterGroup Struct Reference

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>

Collaboration diagram for ParameterGroup:
[legend]

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...
 
ParameterGroupAllocateParameterGroup (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...
 
ParameterGroupCreateAndAddParameterGroupChild (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...
 
ParameterGroupCreateAndAddParameterGroupToParameterSet (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...
 
ParameterNodeGetParameterNodeFromParameterGroupByName (const ParameterGroup *const group_p, const char *const name_s)
 Get the ParameterNode for a Parameter with a given name from a ParameterGroup. More...
 
ParameterGetParameterFromParameterGroupByName (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...
 
LinkedListpg_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...
 
LinkedListpg_params_p
 A list of ParameterNodes for the parameters in this group. More...
 
LinkedListpg_child_groups_p
 A list of ParmameterGroupNodes for any child parameter groups. More...
 
const struct ServiceDatapg_service_data_p
 The ServiceData for the Service that has created this ParametetrGroup. More...
 

Detailed Description

A datatype to tell the system that certain parameters should be grouped together in the client's user interface if possible.

Member Function Documentation

◆ GetParameterGroupVisibility()

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.

Parameters
service_data_pThe ServiceData for the Service that the given ParameterGroup belongs to.
group_name_sThe name of the ParameterGroup to check.
visibility_pPointer to where the value for configured visibility value for the given ParameterGroup will be stored.
Returns
true if the visibility flag was set successfully, false otherwise.

◆ AllocateParameterGroup()

ParameterGroup * AllocateParameterGroup ( const char *  name_s,
const bool  repeatable_flag,
const struct ServiceData service_data_p 
)

Allocate a ParameterGroup.

Parameters
name_sThe name of the ParameterGroup that will be displayed to the user.
key_sAn optional internal key to use by the owning Service. This can be NULL.
service_data_pThe ServiceData for the Service that generates this ParameterGroup.
repeatable_flagtrue if the parameters in this group can be repeated, analogous to a row in a table, false if not.
Returns
The new ParameterGroup or NULL upon error.

◆ FreeParameterGroup()

void FreeParameterGroup ( ParameterGroup param_group_p)

Free a given ParameterGroup.

Parameters
param_group_pThe ParameterGroup to free.

◆ AddParameterGroupAsJSON()

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.

Parameters
param_group_pThe ParameterGroup to get the JSON for.
groups_array_pThe JSON array to add the JSON representation of the ParameterGroup to.
Returns
true if the ParameterGroup was added successfully, false otherwise.

◆ GetParameterGroupAsJSON()

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.

Parameters
param_group_pThe ParameterGroup to get the JSON for.
Returns
The JSON fragment or NULL upon error.

◆ AddParameterGroupChild()

bool AddParameterGroupChild ( ParameterGroup parent_group_p,
ParameterGroup child_group_p 
)

Add a ParameterGroup as a child to another ParameterGroup.

Parameters
parent_group_pThe ParameterGroup to add the child ParameterGroup to.
child_group_pThe ParameterGroup to add.
Returns
true if the ParameterGroup was added successfully, false otherwise.

◆ CreateAndAddParameterGroupChild()

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.

Parameters
parent_group_pThe ParameterGroup to create and add the child ParameterGroup to.
name_sThe name of the ParameterGroup that will be displayed to the user.
repeatable_flagtrue if the parameters in this group can be repeated, analogous to a row in a table, false if not.
add_params_flagIf 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.
Returns
The child ParameterGroup or NULL if there was an error.

◆ RemoveParameterGroupChild()

bool RemoveParameterGroupChild ( ParameterGroup parent_group_p,
ParameterGroup child_group_p 
)

Remove a ParameterGroup child from another ParameterGroup.

Parameters
parent_group_pThe ParameterGroup to remove the child ParameterGroup from.
child_group_pThe ParameterGroup to remove.
Returns
true if the ParameterGroup was removed successfully, false otherwise.

◆ CloneParameters()

bool CloneParameters ( const ParameterGroup *const  src_group_p,
ParameterGroup dest_group_p 
)

Clone all of the Parameters from one ParameterGroup to another.

Parameters
src_group_pThe ParameterGroup to clone the Parameters from
dest_group_pThe ParameterGroup to add the cloned Parameters to.
Returns
true if all of the Parameters were cloned successfully, false otherwise.

◆ AddParameterToParameterGroup()

bool AddParameterToParameterGroup ( ParameterGroup parent_group_p,
Parameter param_p 
)

Add a Parameter to a ParameterGroup.

Parameters
parent_group_pThe ParameterGroup to add the Parameter to.
param_pThe Parameter to add.
Returns
true if the Parameter was added successfully, false otherwise.

◆ CreateAndAddParameterGroupToParameterSet()

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.

Parameters
name_sThe name of the ParameterGroup that will be displayed to the user.
repeatable_flagtrue if the parameters in this group can be repeated, analogous to a row in a table, false if not.
service_data_pThe ServiceData for the Service that generates this ParameterGroup.
param_set_pThe ParameterSet to add the ParameterGroup to.
Returns
The new ParameterGroup or NULL upon error.

◆ GetParameterNodeFromParameterGroupByName()

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.

Parameters
group_pThe ParameterGroup to search.
name_sThe Parameter name to try and match.
Returns
The ParameterNode with the matching Parameter name or NULL if it could not be found

◆ GetParameterFromParameterGroupByName()

Parameter * GetParameterFromParameterGroupByName ( const ParameterGroup *const  group_p,
const char *const  name_s 
)

Get the Parameter with a given name from a ParameterGroup.

Parameters
group_pThe ParameterGroup to search.
name_sThe Parameter name to try and match.
Returns
The Parameter with the matching name or NULL if it could not be found

◆ GetRepeatableParameterGroupName()

char * GetRepeatableParameterGroupName ( ParameterGroup *const  group_p)

Get the name to use for a child of a repeatable ParameterGroup.

Parameters
group_pThe ParameterSet to get the name from.
Returns
The newly-allocated name or NULL if there was an error.

◆ GetRepeatableParameterGroupRegularExpression()

char * GetRepeatableParameterGroupRegularExpression ( const ParameterGroup *const  group_p)

Get the string to use for matching ParameterGroups as children of a repeatable ParameterGroup.

Parameters
group_pThe ParameterGroup to get the regular expresion string from.
Returns
The newly-allocated regular expression string or NULL if there was an error. This value will need to be freed using FreeCopiedString() to avoid a memory leak.

◆ AddRepeatableParameterGroupLabelParam()

bool AddRepeatableParameterGroupLabelParam ( ParameterGroup group_p,
Parameter param_p 
)

Add a Parameter to those used for labelling entries in a repeated ParameterGroup.

Parameters
group_pThe ParameterGroup that the label will be amended for
param_pThe Parameter to use for the label
Returns
true if the ParameterGroup label was updated successfully, false otherwise.

◆ ReplaceParameterInParameterGroup()

bool ReplaceParameterInParameterGroup ( ParameterGroup params_p,
Parameter old_param_p,
Parameter new_param_p 
)

Replace a Parameter in a ParameterGroup.

Parameters
params_pThe ParameterGroup to amend.
old_param_pThe Parameter to remove.
new_param_pThe Parameter to add to the ParameterGroup.
Returns
true if the Parameter was replaced successfully, false otherwise.

Field Documentation

◆ pg_name_s

char* pg_name_s

The name of the ParameterGroup.

◆ pg_visible_flag

bool pg_visible_flag

Should this ParameterGroup initially be visible?

◆ pg_full_display_flag

bool pg_full_display_flag

Should this ParameterGroup have a full display e.g.

a titled legend or simply be a minimal grouping

◆ pg_vertical_layout_flag

bool pg_vertical_layout_flag

Should the ParameterGroup layout its child parameters horizontally or vertically?

◆ pg_repeatable_flag

bool pg_repeatable_flag

Can the parameters in this group be repeated, analogous to a row in a table, false if not.

◆ pg_repeatable_label_params_p

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.

◆ pg_current_repeatable_group_index

uint32 pg_current_repeatable_group_index

If the parameters can be repeated, this is the current index e.g.

row number in a table.

◆ pg_params_p

LinkedList* pg_params_p

A list of ParameterNodes for the parameters in this group.

◆ pg_child_groups_p

LinkedList* pg_child_groups_p

A list of ParmameterGroupNodes for any child parameter groups.

◆ pg_service_data_p

const struct ServiceData* pg_service_data_p

The ServiceData for the Service that has created this ParametetrGroup.


The documentation for this struct was generated from the following files: