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.
integer_observation.h
Go to the documentation of this file.
1 /*
2  * signed_int_observation.h
3  *
4  * Created on: 21 Mar 2022
5  * Author: billy
6  */
7 
8 #ifndef SERVICES_FIELD_TRIALS_SRC_SIGNED_INT_OBSERVATION_H_
9 #define SERVICES_FIELD_TRIALS_SRC_SIGNED_INT_OBSERVATION_H_
10 
11 
12 #include "observation.h"
13 #include "typedefs.h"
14 
15 typedef struct IntegerObservation
16 {
18 
23 
28 
29 
31 
32 
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 
40 
41 DFW_FIELD_TRIAL_SERVICE_LOCAL IntegerObservation *AllocateIntegerObservation (bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const int32 *raw_value_p, const int32 *corrected_value_p,
42  const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s);
43 
44 
46 
47 
49 
50 
52 
53 
54 
56 
57 
59 
60 
62 
63 
65 
66 
67 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddIntegerObservationRawValueToJSON (const IntegerObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
68 
69 
70 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddIntegerObservationCorrectedValueToJSON (const IntegerObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
71 
72 
73 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddIntegerObservationValuesToJSON (const Observation *obs_p, const char *raw_key_s, const char *corrected_key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag);
74 
75 
76 DFW_FIELD_TRIAL_SERVICE_LOCAL bool GetIntegerObservationRawValueAsString (IntegerObservation *observation_p, char **value_ss, bool *free_flag_p);
77 
78 
79 DFW_FIELD_TRIAL_SERVICE_LOCAL bool GetIntegerObservationCorrectedValueAsString (IntegerObservation *observation_p, char **value_ss, bool *free_flag_p);
80 
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 
87 #endif /* SERVICES_FIELD_TRIALS_SRC_SIGNED_INT_OBSERVATION_H_ */
IntegerObservation::io_base_observation
Observation io_base_observation
Definition: integer_observation.h:17
AddIntegerObservationValuesToJSON
bool AddIntegerObservationValuesToJSON(const Observation *obs_p, const char *raw_key_s, const char *corrected_key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
Instrument
Definition: instrument.h:33
MEM_FLAG
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
IntegerObservation
Definition: integer_observation.h:15
SetIntegerObservationCorrectedValueFromJSON
bool SetIntegerObservationCorrectedValueFromJSON(IntegerObservation *observation_p, const json_t *value_p)
GetIntegerObservationCorrectedValueAsString
bool GetIntegerObservationCorrectedValueAsString(IntegerObservation *observation_p, char **value_ss, bool *free_flag_p)
IntegerObservation::io_corrected_value_p
int32 * io_corrected_value_p
The corrected phenotypic value for this Observation.
Definition: integer_observation.h:27
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
MeasuredVariable
Definition: measured_variable.h:39
typedefs.h
GetIntegerObservationAsJSON
json_t * GetIntegerObservationAsJSON(const IntegerObservation *observation_p, const ViewFormat format)
GetIntegerObservationFromJSON
IntegerObservation * GetIntegerObservationFromJSON(const json_t *phenotype_json_p, FieldTrialServiceData *data_p)
AddIntegerObservationCorrectedValueToJSON
bool AddIntegerObservationCorrectedValueToJSON(const IntegerObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
ClearIntegerObservation
void ClearIntegerObservation(Observation *observation_p)
GetIntegerObservationRawValueAsString
bool GetIntegerObservationRawValueAsString(IntegerObservation *observation_p, char **value_ss, bool *free_flag_p)
AddIntegerObservationRawValueToJSON
bool AddIntegerObservationRawValueToJSON(const IntegerObservation *obs_p, const char *key_s, json_t *json_p, const char *null_sequence_s, bool only_if_exists_flag)
SetIntegerObservationRawValueFromString
bool SetIntegerObservationRawValueFromString(IntegerObservation *observation_p, const char *value_s)
ObservationNature
ObservationNature
Definition: observation.h:41
observation.h
Observation
A datatype for storing a phneotypic observation within an experiment.
Definition: observation.h:63
SetIntegerObservationCorrectedValueFromString
bool SetIntegerObservationCorrectedValueFromString(IntegerObservation *observation_p, const char *value_s)
FieldTrialServiceData
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ViewFormat
ViewFormat
An indicator of what the output destination is for the JSON data values.
Definition: view_format.h:19
SetIntegerObservationRawValueFromJSON
bool SetIntegerObservationRawValueFromJSON(IntegerObservation *observation_p, const json_t *value_p)
IntegerObservation::io_raw_value_p
int32 * io_raw_value_p
The raw phenotypic value for this Observation.
Definition: integer_observation.h:22
AllocateIntegerObservation
IntegerObservation * AllocateIntegerObservation(bson_oid_t *id_p, const struct tm *start_date_p, const struct tm *end_date_p, MeasuredVariable *phenotype_p, MEM_FLAG phenotype_mem, const int32 *raw_value_p, const int32 *corrected_value_p, const char *growth_stage_s, const char *method_s, Instrument *instrument_p, const ObservationNature nature, const uint32 *index_p, const char *notes_s)