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.
resource_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  * resource_parameter.h
18  *
19  * Created on: 31 Jan 2020
20  * Author: billy
21  */
22 
23 #ifndef CORE_SHARED_PARAMETERS_INCLUDE_RESOURCE_PARAMETER_H_
24 #define CORE_SHARED_PARAMETERS_INCLUDE_RESOURCE_PARAMETER_H_
25 
26 #include "parameter.h"
28 #include "parameter_set.h"
29 
30 
31 typedef struct ResourceParameter
32 {
34 
36 
39 
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
64 GRASSROOTS_SERVICE_API ResourceParameter *AllocateResourceParameter (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, DataResource *default_value_p, DataResource *current_value_p, ParameterLevel level);
65 
66 
67 GRASSROOTS_SERVICE_API ResourceParameter *AllocateResourceParameterFromJSON (const json_t *param_json_p, const struct Service *service_p, const bool concise_flag);
68 
69 
71 
72 
74 
75 
77 
78 
80 
81 
83 
84 
85 GRASSROOTS_SERVICE_API bool GetCurrentResourceParameterValueFromParameterSet (const ParameterSet * const params_p, const char * const name_s, const DataResource **value_pp);
86 
87 
89 
90 
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif /* CORE_SHARED_PARAMETERS_INCLUDE_RESOURCE_PARAMETER_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
FreeResourceParameter
void FreeResourceParameter(ResourceParameter *param_p)
ResourceParameter::rp_default_value_p
DataResource * rp_default_value_p
Definition: resource_parameter.h:37
SetResourceParameterDefaultValue
bool SetResourceParameterDefaultValue(ResourceParameter *param_p, const DataResource *value_p)
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
GetResourceParameterDefaultValue
const DataResource * GetResourceParameterDefaultValue(const ResourceParameter *param_p)
grassroots_service_library.h
parameter_set.h
GRASSROOTS_SERVICE_API
#define GRASSROOTS_SERVICE_API
Definition: grassroots_service_library.h:49
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
parameter.h
SetResourceParameterCurrentValue
bool SetResourceParameterCurrentValue(ResourceParameter *param_p, const DataResource *value_p)
ResourceParameter::rp_base_param
Parameter rp_base_param
Definition: resource_parameter.h:33
IsResourceParameter
bool IsResourceParameter(const Parameter *param_p)
ResourceParameter::AllocateResourceParameter
ResourceParameter * AllocateResourceParameter(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, DataResource *default_value_p, DataResource *current_value_p, ParameterLevel level)
Allocate a ResourceParameter.
ResourceParameter
Definition: resource_parameter.h:31
SetResourceParameterCurrentValueFromJSON
bool SetResourceParameterCurrentValueFromJSON(ResourceParameter *param_p, const json_t *value_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
ResourceParameter::rp_current_value_p
DataResource * rp_current_value_p
Definition: resource_parameter.h:35
GetCurrentResourceParameterValueFromParameterSet
bool GetCurrentResourceParameterValueFromParameterSet(const ParameterSet *const params_p, const char *const name_s, const DataResource **value_pp)
GetResourceParameterCurrentValue
const DataResource * GetResourceParameterCurrentValue(const ResourceParameter *param_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
AllocateResourceParameterFromJSON
ResourceParameter * AllocateResourceParameterFromJSON(const json_t *param_json_p, const struct Service *service_p, const bool concise_flag)