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.
signed_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  * signed_int_parameter.h
18  *
19  * Created on: 30 Jan 2020
20  * Author: billy
21  */
22 
23 #ifndef CORE_SHARED_PARAMETERS_INCLUDE_SIGNED_INT_PARAMETER_H_
24 #define CORE_SHARED_PARAMETERS_INCLUDE_SIGNED_INT_PARAMETER_H_
25 
26 
27 
28 #include "parameter.h"
30 #include "parameter_set.h"
31 
32 
33 typedef struct SignedIntParameter
34 {
36 
38 
40 
42 
44 
46 
47 
49 {
51  int32 sipo_value;
52 
55 
57 
58 
59 
61 {
63 
65 
67 
68 
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
94  const char * const name_s, const char * const display_name_s,
95  const char * const description_s,
96  const int32 *default_value_p, const int32 *current_value_p,
97  ParameterLevel level);
98 
99 
100 GRASSROOTS_SERVICE_API SignedIntParameter *AllocateSignedIntParameterFromJSON (const json_t *param_json_p, const struct Service *service_p, const bool concise_flag);
101 
102 
103 
105 
106 
108  const char * const name_s, const char * const display_name_s, const char * const description_s,
109  const int32 *default_value_p, uint8 level);
110 
111 
113  const char * const name_s, const char * const display_name_s, const char * const description_s,
114  const int32 *default_value_p, const int32 *current_value_p, uint8 level);
115 
116 
118 
119 
121 
122 
124 
125 
127 
128 
129 GRASSROOTS_SERVICE_API bool SetSignedIntParameterBounds (SignedIntParameter *param_p, const int32 min_value, const int32 max_value);
130 
131 
133 
134 
135 GRASSROOTS_SERVICE_API void GetSignedIntParameterBounds (const SignedIntParameter *param_p, const int32 **min_pp, const int32 **max_pp);
136 
137 
139 
140 
141 GRASSROOTS_SERVICE_API bool GetCurrentSignedIntParameterValueFromParameterSet (const ParameterSet * const params_p, const char * const name_s, const int32 **value_pp);
142 
143 
144 GRASSROOTS_SERVICE_API bool CreateAndAddSignedIntParameterOption (SignedIntParameter *param_p, const int32 value, const char *description_s);
145 
146 
147 GRASSROOTS_SERVICE_API SignedIntParameterOption *AllocateSignedIntParameterOption (const int32 value, const char *description_s);
148 
149 
151 
152 
154 
155 
157 
158 
160 
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 
167 #endif /* CORE_SHARED_PARAMETERS_INCLUDE_SIGNED_INT_PARAMETER_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
GetSignedIntParameterCurrentValue
const int32 * GetSignedIntParameterCurrentValue(const SignedIntParameter *param_p)
ParameterGroup
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
grassroots_service_library.h
SetSignedIntParameterCurrentValue
bool SetSignedIntParameterCurrentValue(SignedIntParameter *param_p, const int32 *value_p)
parameter_set.h
SignedIntParameter::AllocateSignedIntParameter
SignedIntParameter * AllocateSignedIntParameter(const struct ServiceData *service_data_p, const ParameterType pt, const char *const name_s, const char *const display_name_s, const char *const description_s, const int32 *default_value_p, const int32 *current_value_p, ParameterLevel level)
Allocate a SignedIntParameter.
SignedIntParameterOption::sipo_value
int32 sipo_value
The internal value for this option.
Definition: signed_int_parameter.h:51
GRASSROOTS_SERVICE_API
#define GRASSROOTS_SERVICE_API
Definition: grassroots_service_library.h:49
FreeSignedIntParameterOption
void FreeSignedIntParameterOption(SignedIntParameterOption *option_p)
GetSignedIntParameterDefaultValue
const int32 * GetSignedIntParameterDefaultValue(const SignedIntParameter *param_p)
GetCurrentSignedIntParameterValueFromParameterSet
bool GetCurrentSignedIntParameterValueFromParameterSet(const ParameterSet *const params_p, const char *const name_s, const int32 **value_pp)
parameter.h
GetSignedIntParameterBounds
void GetSignedIntParameterBounds(const SignedIntParameter *param_p, const int32 **min_pp, const int32 **max_pp)
CreateAndAddSignedIntParameterToParameterSet
Parameter * CreateAndAddSignedIntParameterToParameterSet(const struct ServiceData *service_data_p, ParameterSet *params_p, ParameterGroup *group_p, ParameterType type, const char *const name_s, const char *const display_name_s, const char *const description_s, const int32 *default_value_p, const int32 *current_value_p, uint8 level)
SignedIntParameter::sip_min_value_p
int32 * sip_min_value_p
Definition: signed_int_parameter.h:41
SignedIntParameter::sip_current_value_p
int32 * sip_current_value_p
Definition: signed_int_parameter.h:37
FreeSignedIntParameter
void FreeSignedIntParameter(SignedIntParameter *param_p)
AllocateSignedIntParameterOption
SignedIntParameterOption * AllocateSignedIntParameterOption(const int32 value, const char *description_s)
SignedIntParameter::sip_default_value_p
int32 * sip_default_value_p
Definition: signed_int_parameter.h:39
FreeStringParameterOptionNode
void FreeStringParameterOptionNode(ListItem *item_p)
SignedIntParameterOption
Definition: signed_int_parameter.h:48
IsSignedIntParameterBounded
bool IsSignedIntParameterBounded(const SignedIntParameter *param_p)
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
SignedIntParameter::sip_base_param
Parameter sip_base_param
Definition: signed_int_parameter.h:35
ParameterLevel
ParameterLevel
The ParameterLevel defines the level that a user should be to adjust the Parameter.
Definition: parameter.h:52
IsSignedIntParameter
bool IsSignedIntParameter(const Parameter *param_p)
SignedIntParameter::sip_max_value_p
int32 * sip_max_value_p
Definition: signed_int_parameter.h:43
AllocateSignedIntParameterFromJSON
SignedIntParameter * AllocateSignedIntParameterFromJSON(const json_t *param_json_p, const struct Service *service_p, const bool concise_flag)
SignedIntParameterOptionNode::sipon_option_p
SignedIntParameterOption * sipon_option_p
Definition: signed_int_parameter.h:64
SignedIntParameterOption::sipo_description_s
char * sipo_description_s
The user-friendly description for this value.
Definition: signed_int_parameter.h:54
AllocateSignedIntParameterOptionNode
SignedIntParameterOptionNode * AllocateSignedIntParameterOptionNode(SignedIntParameterOption *option_p)
EasyCreateAndAddSignedIntParameterToParameterSet
Parameter * EasyCreateAndAddSignedIntParameterToParameterSet(const struct ServiceData *service_data_p, ParameterSet *params_p, ParameterGroup *group_p, ParameterType type, const char *const name_s, const char *const display_name_s, const char *const description_s, const int32 *default_value_p, uint8 level)
SignedIntParameterOptionNode::sipon_node
ListItem sipon_node
Definition: signed_int_parameter.h:62
SetSignedIntParameterDefaultValue
bool SetSignedIntParameterDefaultValue(SignedIntParameter *param_p, const int32 *value_p)
ServiceData
A datatype for holding the configuration data for a Service.
Definition: service.h:126
CreateAndAddSignedIntParameterOption
bool CreateAndAddSignedIntParameterOption(SignedIntParameter *param_p, const int32 value, const char *description_s)
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
SetSignedIntParameterCurrentValueFromJSON
bool SetSignedIntParameterCurrentValueFromJSON(SignedIntParameter *param_p, const json_t *value_p)
SetSignedIntParameterBounds
bool SetSignedIntParameterBounds(SignedIntParameter *param_p, const int32 min_value, const int32 max_value)
SignedIntParameterOptionNode
Definition: signed_int_parameter.h:60
ListItem
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43
SignedIntParameter
Definition: signed_int_parameter.h:33