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.
boolean_parameter.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2020 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 /*
17  * boolean_parameter.h
18  *
19  * Created on: 30 Jan 2020
20  * Author: billy
21  */
22 
23 #ifndef CORE_SHARED_PARAMETERS_INCLUDE_BOOLEAN_PARAMETER_H_
24 #define CORE_SHARED_PARAMETERS_INCLUDE_BOOLEAN_PARAMETER_H_
25 
26 #include "parameter.h"
28 #include "parameter_set.h"
29 
30 
31 /* forward declaration */
32 struct ServiceData;
33 
34 typedef struct BooleanParameter
35 {
37 
39 
42 
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
67 GRASSROOTS_SERVICE_API BooleanParameter *AllocateBooleanParameter (const struct ServiceData *service_data_p, const char * const name_s, const char * const display_name_s, const char * const description_s, const bool *default_value_p, const bool *current_value_p, ParameterLevel level);
68 
69 
70 GRASSROOTS_SERVICE_API BooleanParameter *AllocateBooleanParameterFromJSON (const json_t *param_json_p, const struct Service *service_p, const bool concise_flag);
71 
72 
74  const char * const name_s, const char * const display_name_s, const char * const description_s,
75  const bool *default_value_p, uint8 level);
76 
77 
78 
80  const char * const name_s, const char * const display_name_s, const char * const description_s,
81  const bool *default_value_p, const bool *current_value_p, uint8 level);
82 
83 
85 
86 
88 
89 
91 
92 
94 
95 
97 
98 
100 
101 
102 GRASSROOTS_SERVICE_API bool GetCurrentBooleanParameterValueFromParameterSet (const ParameterSet * const params_p, const char * const name_s, const bool **value_pp);
103 
104 
106 
107 
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 
114 
115 
116 #endif /* CORE_SHARED_PARAMETERS_INCLUDE_BOOLEAN_PARAMETER_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
EasyCreateAndAddBooleanParameterToParameterSet
Parameter * EasyCreateAndAddBooleanParameterToParameterSet(const struct ServiceData *service_data_p, ParameterSet *params_p, ParameterGroup *group_p, const char *const name_s, const char *const display_name_s, const char *const description_s, const bool *default_value_p, uint8 level)
ParameterGroup
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
BooleanParameter::bp_base_param
Parameter bp_base_param
Definition: boolean_parameter.h:36
grassroots_service_library.h
parameter_set.h
GRASSROOTS_SERVICE_API
#define GRASSROOTS_SERVICE_API
Definition: grassroots_service_library.h:49
IsBooleanParameter
bool IsBooleanParameter(const Parameter *param_p)
parameter.h
BooleanParameter::AllocateBooleanParameter
BooleanParameter * AllocateBooleanParameter(const struct ServiceData *service_data_p, const char *const name_s, const char *const display_name_s, const char *const description_s, const bool *default_value_p, const bool *current_value_p, ParameterLevel level)
Allocate a BooleanParameter.
FreeBooleanParameter
void FreeBooleanParameter(BooleanParameter *param_p)
BooleanParameter::bp_current_value_p
bool * bp_current_value_p
Definition: boolean_parameter.h:38
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
BooleanParameter::bp_default_value_p
bool * bp_default_value_p
Definition: boolean_parameter.h:40
BooleanParameter
Definition: boolean_parameter.h:34
ParameterLevel
ParameterLevel
The ParameterLevel defines the level that a user should be to adjust the Parameter.
Definition: parameter.h:52
GetCurrentBooleanParameterValueFromParameterSet
bool GetCurrentBooleanParameterValueFromParameterSet(const ParameterSet *const params_p, const char *const name_s, const bool **value_pp)
SetBooleanParameterCurrentValueFromJSON
bool SetBooleanParameterCurrentValueFromJSON(BooleanParameter *param_p, const json_t *value_p)
SetBooleanParameterDefaultValue
bool SetBooleanParameterDefaultValue(BooleanParameter *param_p, const bool *value_p)
AllocateBooleanParameterFromJSON
BooleanParameter * AllocateBooleanParameterFromJSON(const json_t *param_json_p, const struct Service *service_p, const bool concise_flag)
CreateAndAddBooleanParameterToParameterSet
Parameter * CreateAndAddBooleanParameterToParameterSet(const struct ServiceData *service_data_p, ParameterSet *params_p, ParameterGroup *group_p, const char *const name_s, const char *const display_name_s, const char *const description_s, const bool *default_value_p, const bool *current_value_p, uint8 level)
GetBooleanParameterDefaultValue
const bool * GetBooleanParameterDefaultValue(const BooleanParameter *param_p)
SetBooleanParameterCurrentValue
bool SetBooleanParameterCurrentValue(BooleanParameter *param_p, const bool *value_p)
ServiceData
A datatype for holding the configuration data for a Service.
Definition: service.h:126
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
GetBooleanParameterCurrentValue
const bool * GetBooleanParameterCurrentValue(const BooleanParameter *param_p)