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.
treatment_factor_value.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  * treatment_factor_value.h
18  *
19  * Created on: 25 Jan 2021
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_TREATMENT_FACTOR_VALUE_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_TREATMENT_FACTOR_VALUE_H_
25 
28 
29 #include "treatment_factor.h"
30 
31 
32 typedef struct TreatmentFactorValue
33 {
35 
36  char *tfv_label_s;
37 
39 
40 
42 {
44 
47 
48 
49 /* forward declarations */
50 struct Study;
51 
52 
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57 
58 
60 
62 
64 
65 DFW_FIELD_TRIAL_SERVICE_LOCAL void FreeTreatmentFactorValueNode (ListItem *treatment_factor_value_node_p);
66 
67 DFW_FIELD_TRIAL_SERVICE_LOCAL const char *GetTreatmentFactorLabelValue (const TreatmentFactorValue *treatment_factor_value_p);
68 
70 
72 
73 DFW_FIELD_TRIAL_SERVICE_LOCAL TreatmentFactorValue *GetTreatmentFactorValueFromJSON (const json_t *tf_value_json_p, const struct Study *study_p, const FieldTrialServiceData *data_p);
74 
75 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetTreatmentFactorValueAsJSON (const TreatmentFactorValue *tf_value_p, const struct Study *study_p);
76 
77 
78 #ifdef _cplusplus
79 }
80 #endif
81 
82 
83 
84 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_TREATMENT_FACTOR_VALUE_H_ */
FreeTreatmentFactorValueNode
void FreeTreatmentFactorValueNode(ListItem *treatment_factor_value_node_p)
TreatmentFactorValue::tfv_factor_p
TreatmentFactor * tfv_factor_p
Definition: treatment_factor_value.h:34
GetTreatmentFactorLabelValue
const char * GetTreatmentFactorLabelValue(const TreatmentFactorValue *treatment_factor_value_p)
TreatmentFactorValueNode::tfvn_node
ListItem tfvn_node
Definition: treatment_factor_value.h:43
FreeTreatmentFactorValue
void FreeTreatmentFactorValue(TreatmentFactorValue *treatment_factor_value_p)
GetTreatmentIdForTreatmentFactorValue
const bson_oid_t * GetTreatmentIdForTreatmentFactorValue(const TreatmentFactorValue *tfv_p)
TreatmentFactor
A TreatmentFactor is a set of values for a Treatment applied to plots within a Study.
Definition: treatment_factor.h:76
dfw_field_trial_service_library.h
AllocateTreatmentFactorValue
TreatmentFactorValue * AllocateTreatmentFactorValue(TreatmentFactor *treatment_factor_p, const char *label_s)
AllocateTreatmentFactorValueNode
TreatmentFactorValueNode * AllocateTreatmentFactorValueNode(TreatmentFactorValue *treatment_factor_value_p)
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
GetTreatmentFactorValueAsJSON
json_t * GetTreatmentFactorValueAsJSON(const TreatmentFactorValue *tf_value_p, const struct Study *study_p)
GetTreatmentFactorValueFromJSON
TreatmentFactorValue * GetTreatmentFactorValueFromJSON(const json_t *tf_value_json_p, const struct Study *study_p, const FieldTrialServiceData *data_p)
dfw_field_trial_service_data.h
AreTreatmentFactorValuesMatching
bool AreTreatmentFactorValuesMatching(const TreatmentFactorValue *tfv_0_p, const TreatmentFactorValue *tfv_1_p)
treatment_factor.h
FieldTrialServiceData
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
TreatmentFactorValue
Definition: treatment_factor_value.h:32
TreatmentFactorValue::tfv_label_s
char * tfv_label_s
Definition: treatment_factor_value.h:36
TreatmentFactorValueNode
Definition: treatment_factor_value.h:41
Study
Definition: study.h:182
TreatmentFactorValueNode::tfvn_value_p
TreatmentFactorValue * tfvn_value_p
Definition: treatment_factor_value.h:45
ListItem
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43