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)
 Add the JSON fragment detailing a given ParameterGroup to a given JSON array. More...
 
json_t * GetParameterGroupAsJSON (ParameterGroup *param_group_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...
 

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...
 
uint32 pg_current_repeatable_group_index
 If the parameters can be repeated, this is the current index e.g. More...
 
uint32 pg_num_params
 The number of Parameters in this ParameterGroup. 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 
)

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 ( ParameterGroup param_group_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 ParameterSet 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.

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_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_num_params

uint32 pg_num_params

The number of Parameters in this ParameterGroup.

◆ 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: