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.
|
Go to the documentation of this file.
104 #define SET_NAMED_PARAMETER_TYPE_TAGS(a,b) ({ .npt_name_s = a, .npt_type = b})
230 #ifndef DOXYGEN_SHOULD_SKIP_THIS
233 #ifdef ALLOCATE_PARAMETER_TAGS
234 #define PARAMETER_PREFIX GRASSROOTS_SERVICE_API
235 #define PARAMETER_VAL(x) = x
236 #define PARAMETER_CONCAT_VAL(x,y) = x y
238 #define PARAMETER_PREFIX extern GRASSROOTS_SERVICE_API
239 #define PARAMETER_VAL(x)
240 #define PARAMETER_CONCAT_VAL(x,y)
252 PARAMETER_PREFIX
const char *
const PA_TABLE_COLUMN_HEADERS_PLACEMENT_S
PARAMETER_VAL(
"Column Headers Placement");
254 PARAMETER_PREFIX
const char *
const PA_TABLE_COLUMN_HEADINGS_S
PARAMETER_VAL(
"Column Headings");
256 PARAMETER_PREFIX
const char *
const PA_TABLE_ROW_HEADINGS_S
PARAMETER_VAL(
"Row Headings");
258 PARAMETER_PREFIX
const char *
const PA_TABLE_COLUMN_DELIMITER_S
PARAMETER_VAL(
"Column Delimiter");
260 PARAMETER_PREFIX
const char *
const PA_TABLE_ADD_COLUMNS_FLAG_S
PARAMETER_VAL(
"Add User-Definable Columns");
262 PARAMETER_PREFIX
const char *
const PA_TABLE_ROW_DELIMITER_S
PARAMETER_VAL(
"Row Delimiter");
264 PARAMETER_PREFIX
const char *
const PA_TABLE_DEFAULT_COLUMN_DELIMITER_S
PARAMETER_VAL(
",");
266 PARAMETER_PREFIX
const char *
const PA_TABLE_DEFAULT_ROW_DELIMITER_S
PARAMETER_VAL(
"\n");
268 PARAMETER_PREFIX
const char *
const PA_DOUBLE_PRECISION_S
PARAMETER_VAL(
"precision");
270 PARAMETER_PREFIX
const char *
const PA_TYPE_STRING_ARRAY_S
PARAMETER_VAL(
"string_array");
272 PARAMETER_PREFIX
const char *
const PA_TYPE_TIME_ARRAY_S
PARAMETER_VAL(
"time_array");
274 PARAMETER_PREFIX
const char *
const PA_TYPE_STRING_S
PARAMETER_VAL(
"string");
276 PARAMETER_PREFIX
const char *
const PA_TYPE_BOOLEAN_S
PARAMETER_VAL(
"boolean");
278 PARAMETER_PREFIX
const char *
const PA_TYPE_INTEGER_S
PARAMETER_VAL(
"integer");
280 PARAMETER_PREFIX
const char *
const PA_TYPE_NUMBER_S
PARAMETER_VAL(
"number");
282 PARAMETER_PREFIX
const char *
const PA_TYPE_CHARACTER_S
PARAMETER_VAL(
"character");
285 PARAMETER_PREFIX
const char *
const PA_TABLE_COLUMN_HEADERS_PLACEMENT_FIRST_ROW_S
PARAMETER_VAL(
"Column Headers Placement On First Row");
315 const char *
const display_name_s,
const char *
const description_s,
ParameterLevel level,
317 bool (*add_values_to_json_fn) (
const Parameter *param_p, json_t *param_json_p,
const bool full_definition_flag),
319 bool (*set_value_from_string_fn) (
struct Parameter *param_p,
const char *value_s)
704 bool (*add_values_to_json_fn) (
const Parameter *param_p, json_t *param_json_p,
const bool full_definition_flag),
706 bool (*set_value_from_string_fn) (
Parameter *param_p,
const char *value_s));
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
bool IsJSONParameterConcise(const json_t *const json_p)
Does the JSON fragment describe a full set of a Parameter's features or just enough to get its curren...
This is a datatype to store the versioning details for the Grassroots JSON schema that is being used.
Definition: schema_version.h:44
ParameterType pa_type
The type of the parameter.
Definition: parameter.h:124
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
Parameter * CloneParameter(const Parameter *const src_p, const struct ServiceData *data_p)
Clone a Parameter.
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
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.
const PARAMETER_PREFIX char *const PA_TABLE_COLUMN_HEADERS_PLACEMENT_S PARAMETER_VAL("Column Headers Placement")
bool InitParameter(Parameter *param_p, const struct ServiceData *service_data_p, ParameterType type, const char *const name_s, const char *const display_name_s, const char *const description_s, ParameterLevel level, void(*clear_fn)(Parameter *param_p), bool(*add_values_to_json_fn)(const Parameter *param_p, json_t *param_json_p, const bool full_definition_flag), struct Parameter *(*clone_fn)(const Parameter *param_p, const struct ServiceData *service_data_p), bool(*set_value_from_string_fn)(struct Parameter *param_p, const char *value_s))
Allocate a Parameter.
#define GRASSROOTS_SERVICE_API
Definition: grassroots_service_library.h:49
const char * GetParameterLevelAsString(const ParameterLevel level)
Get the string representation of a given ParameterLevel.
const char * CheckForSignedReal(const Parameter *const parameter_p, const void *value_p)
Check whether the value of a Parameter is a non-negative real value.
ListItem pn_node
The ListItem.
Definition: parameter.h:222
char * pa_display_name_s
An optional user-friendly name of the parameter to use for client user interfaces.
Definition: parameter.h:130
bool GetGrassrootsTypeFromString(const char *param_type_s, ParameterType *param_type_p)
Get the ParameterType from its human-readable name.
The value of a ParameterLevel for Parameters that are considered the options suitable for all levels.
Definition: parameter.h:70
void(* pa_clear_fn)(struct Parameter *param_p)
Definition: parameter.h:195
LinkedList * pa_remote_parameter_details_p
A LinkedList of RemoteParameterNodes that hold the information for Parameters for PairedServices to t...
Definition: parameter.h:169
bool pa_read_only_flag
Is the Parameter read-only?
Definition: parameter.h:208
bool SetParameterCurrentValueFromJSON(Parameter *param_p, const json_t *value_p)
#define GRASSROOTS_SERVICE_LOCAL
Definition: grassroots_service_library.h:50
ParameterNode * AllocateParameterNode(Parameter *param_p)
Allocate a ParameterNode for a given Parameter so that it can be stored upon a LinkedList.
struct ParameterGroup * pa_group_p
The ParameterGroup to which this Parameter belongs.
Definition: parameter.h:161
bool GetParameterDescriptionFromConfig(const struct ServiceData *service_data_p, const char *param_name_s, char **description_ss)
Get the configured description for a given Parameter.
bool AddParameterKeyJSONValuePair(Parameter *const parameter_p, const char *key_s, const json_t *value_p)
Parameter * CreateParameterFromJSON(const json_t *const root_p, struct Service *service_p, const bool concise_flag)
Create a Parameter from a json-based representation.
bool CopyRemoteParameterDetails(const Parameter *const src_param_p, Parameter *dest_param_p)
Make a deep copy of all of the RemoteParameterDetails stored on one Parameter to another.
LinkedList * pa_options_p
If the parameter can only take one of a constrained set of values, this will be a LinkedList of Param...
Definition: parameter.h:143
const char * GetGrassrootsTypeAsString(const ParameterType param_type)
Get the human-readable name for a given ParameterType.
const ParameterType npt_type
The read-only ParameterType for the Parameter with the name given by npt_name_s.
Definition: parameter.h:94
char * GetParameterValueAsString(const Parameter *const param_p, bool *alloc_flag_p)
Get the current value of a Parameter as a string.
The value of a ParameterLevel for Parameters that are considered the most simple options.
Definition: parameter.h:58
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
bool AddRemoteDetailsToParameter(Parameter *param_p, const char *const uri_s, const char *const name_s)
Create a RemoteParameterDetails and add it to the given Parameter.
LinkedList * GetParameterStringMultiOptions(Parameter *param_p)
ParameterLevel
The ParameterLevel defines the level that a user should be to adjust the Parameter.
Definition: parameter.h:52
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
bool AddParameterValuesToJSON(const Parameter *param_p, json_t *param_json_p, const bool full_definition_flag)
ParameterLevel pa_level
The level of the parameter.
Definition: parameter.h:148
void NullifyParameter(Parameter *param_p)
Set a given Parameter's member variables to initial empty, NULL or false values.
const char * GetUIName(const Parameter *const parameter_p)
Get the name to use for a Client to use for this Parameter.
HashTable * pa_store_p
A map allowing the Parameter to store an arbitrary set of key-value pairs.
Definition: parameter.h:154
bool GetParameterLevelFromConfig(const struct ServiceData *service_data_p, const char *param_name_s, ParameterLevel *level_p)
Get the configured ParameterLevel for a given Parameter.
bool pa_required_flag
Must this Parameter contain a valid value or can it be empty?
Definition: parameter.h:192
void ClearParameter(Parameter *param_p)
Clear a Parameter.
bool AddParameterKeyStringValuePair(Parameter *const parameter_p, const char *key_s, const char *value_s)
Add a key value pair to a Parameter.
const char * CheckForNotNull(const Parameter *const parameter_p, const void *value_p)
Check whether the value of a Parameter is not NULL.
const char *const npt_name_s
The read-only name of the Parameter.
Definition: parameter.h:88
bool GetParameterLevelFromString(const char *level_s, ParameterLevel *level_p)
Get the ParameterLevel from a string representation.
bool CompareParameterLevels(const ParameterLevel param_level, const ParameterLevel threshold)
Test whether a given ParameterLevel matches or exceeds another.
json_t * GetRunnableParameterAsJSON(const Parameter *param_p, const SchemaVersion *const sv_p, const bool full_definition_flag)
Get the minimal json-based representation of a Parameter needed to run one or more ServiceJobs.
bool SetParameterCurrentValueFromString(Parameter *const param_p, const char *value_s)
Set the current value of a Parameter from a string.
char * pa_description_s
The description for this parameter.
Definition: parameter.h:133
void FreeParameter(Parameter *param_p)
Free a Parameter.
const char * GetParameterKeyValue(const Parameter *const parameter_p, const char *key_s)
Get a value from a Parameter.
void FreeParameterNode(ListItem *node_p)
Free a ParameterNode.
bool(* pa_set_value_from_string_fn)(struct Parameter *param_p, const char *value_s)
Definition: parameter.h:202
void RemoveParameterKeyValuePair(Parameter *const parameter_p, const char *key_s)
Remove a key value pair from a Parameter.
json_t * GetParameterAsJSON(const Parameter *const parameter_p, const SchemaVersion *const sv_p, const bool full_definition_flag)
Get the json-based representation of a Parameter.
A datatype for storing Parameters in a LinkedList.
Definition: parameter.h:219
A datatype for holding the configuration data for a Service.
Definition: service.h:126
bool pa_refresh_service_flag
When the value of this Parameter is changed in the client, should it make a request to the server to ...
Definition: parameter.h:186
bool AddColumnParameterHint(const char *name_s, const char *description_s, const ParameterType param_type, const bool required_flag, json_t *array_p)
const json_t * GetParameterFromConfig(const json_t *service_config_p, const char *const param_name_s)
void SetParameterCallbacks(Parameter *param_p, void(*clear_fn)(Parameter *param_p), bool(*add_values_to_json_fn)(const Parameter *param_p, json_t *param_json_p, const bool full_definition_flag), Parameter *(*clone_fn)(const Parameter *param_p, const struct ServiceData *data_p), bool(*set_value_from_string_fn)(Parameter *param_p, const char *value_s))
bool GetParameterDisplayNameFromConfig(const struct ServiceData *service_data_p, const char *param_name_s, char **display_name_ss)
Get the configured display name for a given Parameter.
bool InitParameterFromJSON(Parameter *param_p, const json_t *const root_p, const struct Service *service_p, const bool concise_flag, const ParameterType *pt_p)
The value of a ParameterLevel for Parameters that are considered the options that require the most ex...
Definition: parameter.h:64
bool AddParameterLevelToJSON(const ParameterLevel level, json_t *root_p, const SchemaVersion *const sv_p)
bool(* pa_add_values_to_json_fn)(const struct Parameter *param_p, json_t *param_json_p, const bool full_definition_flag)
Definition: parameter.h:198
bool pa_visible_flag
Should this Parameter be displayed to the user or is it a hidden variable.
Definition: parameter.h:176
char * pa_name_s
The name of the parameter.
Definition: parameter.h:127
A container using HashBuckets to allow for fast lookup of key-value pairs.
Definition: hash_table.h:139
const char * GetNamedParameterDefaultValueFromJSON(const char *id_param_s, const json_t *params_json_p)
Parameter * pn_parameter_p
Pointer to the associated Parameter.
Definition: parameter.h:225
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43