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.
unsigned_int_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  * unsigned_int_parameter.h
18  *
19  * Created on: 31 Jan 2020
20  * Author: billy
21  */
22 
23 #ifndef CORE_SHARED_PARAMETERS_INCLUDE_UNSIGNED_INT_PARAMETER_H_
24 #define CORE_SHARED_PARAMETERS_INCLUDE_UNSIGNED_INT_PARAMETER_H_
25 
26 
27 
28 #include "parameter.h"
30 #include "parameter_set.h"
31 
32 
33 typedef struct UnsignedIntParameter
34 {
36 
38 
40 
41  uint32 *uip_min_value_p;
42 
43  uint32 *uip_max_value_p;
44 
46 
47 
49 {
51  uint32 uipo_value;
52 
55 
57 
58 
60 {
62 
64 
66 
67 
68 
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
93 GRASSROOTS_SERVICE_API UnsignedIntParameter *AllocateUnsignedIntParameter (const struct ServiceData *service_data_p, const char * const name_s, const char * const display_name_s, const char * const description_s, const uint32 *default_value_p, const uint32 *current_value_p, ParameterLevel level);
94 
95 
96 GRASSROOTS_SERVICE_API UnsignedIntParameter *AllocateUnsignedIntParameterFromJSON (const json_t *param_json_p, const struct Service *service_p, const bool concise_flag);
97 
98 
100  const char * const name_s, const char * const display_name_s, const char * const description_s,
101  const uint32 *default_value_p, uint8 level);
102 
103 
104 
106  const char * const name_s, const char * const display_name_s, const char * const description_s,
107  const uint32 *default_value_p, const uint32 *current_value_p, uint8 level);
108 
109 
111 
112 
114 
115 
117 
118 
120 
121 
123 
124 
125 GRASSROOTS_SERVICE_API bool SetUnsignedIntParameterBounds (UnsignedIntParameter *param_p, const uint32 min_value, const uint32 max_value);
126 
127 
129 
130 
131 GRASSROOTS_SERVICE_API void GetUnsignedIntParameterBounds (const UnsignedIntParameter *param_p, const uint32 **min_pp, const uint32 **max_pp);
132 
133 
135 
136 
137 GRASSROOTS_SERVICE_API bool GetCurrentUnsignedIntParameterValueFromParameterSet (const ParameterSet * const params_p, const char * const name_s, const uint32 **value_pp);
138 
139 
140 GRASSROOTS_SERVICE_API bool CreateAndAddUnsignedIntParameterOption (UnsignedIntParameter *param_p, const uint32 value, const char *description_s);
141 
142 
143 GRASSROOTS_SERVICE_API UnsignedIntParameterOption *AllocateUnsignedIntParameterOption (const uint32 value, const char *description_s);
144 
145 
147 
148 
150 
151 
153 
154 
156 
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 
163 #endif /* CORE_SHARED_PARAMETERS_INCLUDE_UNSIGNED_INT_PARAMETER_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
ParameterGroup
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
UnsignedIntParameter
Definition: unsigned_int_parameter.h:33
grassroots_service_library.h
GetUnsignedIntParameterDefaultValue
const uint32 * GetUnsignedIntParameterDefaultValue(const UnsignedIntParameter *param_p)
parameter_set.h
GRASSROOTS_SERVICE_API
#define GRASSROOTS_SERVICE_API
Definition: grassroots_service_library.h:49
UnsignedIntParameter::uip_base_param
Parameter uip_base_param
Definition: unsigned_int_parameter.h:35
CreateAndAddUnsignedIntParameterToParameterSet
Parameter * CreateAndAddUnsignedIntParameterToParameterSet(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 uint32 *default_value_p, const uint32 *current_value_p, uint8 level)
IsUnsignedIntParameterBounded
bool IsUnsignedIntParameterBounded(const UnsignedIntParameter *param_p)
UnsignedIntParameterOptionNode
Definition: unsigned_int_parameter.h:59
parameter.h
EasyCreateAndAddUnsignedIntParameterToParameterSet
Parameter * EasyCreateAndAddUnsignedIntParameterToParameterSet(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 uint32 *default_value_p, uint8 level)
GetCurrentUnsignedIntParameterValueFromParameterSet
bool GetCurrentUnsignedIntParameterValueFromParameterSet(const ParameterSet *const params_p, const char *const name_s, const uint32 **value_pp)
UnsignedIntParameter::uip_default_value_p
uint32 * uip_default_value_p
Definition: unsigned_int_parameter.h:39
SetUnsignedIntParameterCurrentValueFromJSON
bool SetUnsignedIntParameterCurrentValueFromJSON(UnsignedIntParameter *param_p, const json_t *value_p)
FreeUnsignedIntParameterOption
void FreeUnsignedIntParameterOption(UnsignedIntParameterOption *option_p)
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
ParameterLevel
ParameterLevel
The ParameterLevel defines the level that a user should be to adjust the Parameter.
Definition: parameter.h:52
AllocateUnsignedIntParameterOption
UnsignedIntParameterOption * AllocateUnsignedIntParameterOption(const uint32 value, const char *description_s)
GetUnsignedIntParameterBounds
void GetUnsignedIntParameterBounds(const UnsignedIntParameter *param_p, const uint32 **min_pp, const uint32 **max_pp)
UnsignedIntParameterOption::uipo_value
uint32 uipo_value
The internal value for this option.
Definition: unsigned_int_parameter.h:51
AllocateUnsignedIntParameterOptionNode
UnsignedIntParameterOptionNode * AllocateUnsignedIntParameterOptionNode(UnsignedIntParameterOption *option_p)
AllocateUnsignedIntParameterFromJSON
UnsignedIntParameter * AllocateUnsignedIntParameterFromJSON(const json_t *param_json_p, const struct Service *service_p, const bool concise_flag)
UnsignedIntParameter::uip_max_value_p
uint32 * uip_max_value_p
Definition: unsigned_int_parameter.h:43
UnsignedIntParameterOption
Definition: unsigned_int_parameter.h:48
FreeStringParameterOptionNode
void FreeStringParameterOptionNode(ListItem *item_p)
FreeUnsignedIntParameter
void FreeUnsignedIntParameter(UnsignedIntParameter *param_p)
SetUnsignedIntParameterCurrentValue
bool SetUnsignedIntParameterCurrentValue(UnsignedIntParameter *param_p, const uint32 *value_p)
ServiceData
A datatype for holding the configuration data for a Service.
Definition: service.h:126
UnsignedIntParameterOptionNode::uipon_option_p
UnsignedIntParameterOption * uipon_option_p
Definition: unsigned_int_parameter.h:63
CreateAndAddUnsignedIntParameterOption
bool CreateAndAddUnsignedIntParameterOption(UnsignedIntParameter *param_p, const uint32 value, const char *description_s)
UnsignedIntParameter::uip_min_value_p
uint32 * uip_min_value_p
Definition: unsigned_int_parameter.h:41
UnsignedIntParameter::uip_current_value_p
uint32 * uip_current_value_p
Definition: unsigned_int_parameter.h:37
UnsignedIntParameterOption::uipo_description_s
char * uipo_description_s
The user-friendly description for this value.
Definition: unsigned_int_parameter.h:54
IsUnsignedIntParameter
bool IsUnsignedIntParameter(const Parameter *param_p)
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
UnsignedIntParameterOptionNode::uipon_node
ListItem uipon_node
Definition: unsigned_int_parameter.h:61
SetUnsignedIntParameterDefaultValue
bool SetUnsignedIntParameterDefaultValue(UnsignedIntParameter *param_p, const uint32 *value_p)
UnsignedIntParameter::AllocateUnsignedIntParameter
UnsignedIntParameter * AllocateUnsignedIntParameter(const struct ServiceData *service_data_p, const char *const name_s, const char *const display_name_s, const char *const description_s, const uint32 *default_value_p, const uint32 *current_value_p, ParameterLevel level)
Allocate a UnsignedIntParameter.
GetUnsignedIntParameterCurrentValue
const uint32 * GetUnsignedIntParameterCurrentValue(const UnsignedIntParameter *param_p)
SetUnsignedIntParameterBounds
bool SetUnsignedIntParameterBounds(UnsignedIntParameter *param_p, const uint32 min_value, const uint32 max_value)
ListItem
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43