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.
mapped_parameter.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 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 
21 /*
22  * mapped_parameter.h
23  *
24  * Created on: 7 Sep 2016
25  * Author: tyrrells
26  */
27 
28 #ifndef SERVER_SRC_SERVICES_LIB_INCLUDE_MAPPED_PARAMETER_H_
29 #define SERVER_SRC_SERVICES_LIB_INCLUDE_MAPPED_PARAMETER_H_
30 
31 #include "jansson.h"
32 
34 
35 #include "linked_list.h"
36 
37 #include "parameter_set.h"
38 
39 
40 
41 /* forward declarations */
42 struct ServiceJob;
43 
44 
52 typedef struct MappedParameter
53 {
60 
70 
71 
76 
77 
83 
84 
92 typedef struct MappedParameterNode
93 {
96 
100 
101 
102 #ifdef __cplusplus
103 extern "C"
104 {
105 #endif
106 
117 GRASSROOTS_SERVICE_API MappedParameter *AllocateMappedParameter (const char *input_s, const char *output_s, bool required_flag, bool multi_flag);
118 
119 
127 GRASSROOTS_SERVICE_API MappedParameter *CreateMappedParameterFromJSON (const json_t *mapped_param_json_p);
128 
129 
137 
138 
147 
148 
156 
157 
168 GRASSROOTS_SERVICE_API bool SetMappedStringParameterValue (MappedParameter *mapped_param_p, ParameterSet *params_p, const char *param_name_s);
169 
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 
176 #endif /* SERVER_SRC_SERVICES_LIB_INCLUDE_MAPPED_PARAMETER_H_ */
MappedParameterNode
This datatype allows the storage of MappedParameters on a LinkedList.
Definition: mapped_parameter.h:92
MappedParameter::mp_required_flag
bool mp_required_flag
Is this MappedParameter required for the LinkedService to run?
Definition: mapped_parameter.h:75
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
grassroots_service_library.h
parameter_set.h
GRASSROOTS_SERVICE_API
#define GRASSROOTS_SERVICE_API
Definition: grassroots_service_library.h:49
MappedParameter::SetMappedStringParameterValue
bool SetMappedStringParameterValue(MappedParameter *mapped_param_p, ParameterSet *params_p, const char *param_name_s)
Set a Parameter value within a given ParameterSet by a MappedParameter's defintion.
MappedParameter::FreeMappedParameter
void FreeMappedParameter(MappedParameter *mapped_param_p)
Free a MappedParameter.
MappedParameter::AllocateMappedParameter
MappedParameter * AllocateMappedParameter(const char *input_s, const char *output_s, bool required_flag, bool multi_flag)
Allocate a MappedParameter for the given Parameter names.
MappedParameterNode::mpn_node
ListItem mpn_node
The base node.
Definition: mapped_parameter.h:95
MappedParameter::mp_multiple_flag
bool mp_multiple_flag
Can there be multiple input values?
Definition: mapped_parameter.h:81
MappedParameter::FreeMappedParameterNode
void FreeMappedParameterNode(ListItem *node_p)
Free a MappedParameterNode and its associated MappedParameter.
MappedParameter::AllocateMappedParameterNode
MappedParameterNode * AllocateMappedParameterNode(MappedParameter *mapped_param_p)
Allocate a MappedParameterNode to store a MappedParameter on a LinkedList.
MappedParameter::mp_output_param_s
char * mp_output_param_s
This is name of the parameter in the second service.
Definition: mapped_parameter.h:69
linked_list.h
A doubly-linked list.
MappedParameter
This structure is used to store a relationship between a value from the output of running one service...
Definition: mapped_parameter.h:52
MappedParameterNode::mpn_mapped_param_p
MappedParameter * mpn_mapped_param_p
A pointer to the MappedParameter to store.
Definition: mapped_parameter.h:98
LinkedService::CreateMappedParameterFromJSON
MappedParameter * CreateMappedParameterFromJSON(const json_t *mapped_param_json_p)
Create a new MappedParameter from a JSON fragment.
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
ListItem
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43
MappedParameter::mp_input_param_s
char * mp_input_param_s
This is the selector to get the value from the first service's output.
Definition: mapped_parameter.h:59