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.
person_jobs.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2018 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  * person.h
18  *
19  * Created on: 19 Dec 2018
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_PERSON_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_PERSON_JOBS_H_
25 
28 #include "jansson.h"
29 
30 #include "person.h"
31 #include "parameter_set.h"
32 #include "parameter_group.h"
33 #include "linked_list.h"
34 #include "operation.h"
35 
36 
37 #ifdef ALLOCATE_PERSON_JOB_TAGS
38  #define PERSON_JOB_PREFIX DFW_FIELD_TRIAL_SERVICE_LOCAL
39  #define PERSON_JOB_VAL(x) = x
40  #define PERSON_JOB_STRUCT_VAL(x,y) = {x, y}
41 #else
42  #define PERSON_JOB_PREFIX extern
43  #define PERSON_JOB_VAL(x)
44  #define PERSON_JOB_STRUCT_VAL(x,y)
45 #endif
46 
47 
51 PERSON_JOB_PREFIX NamedParameterType PERSON_AFFILIATION PERSON_JOB_STRUCT_VAL("PE Affiliation", PT_STRING);
53 
54 
55 #ifdef __cplusplus
56 extern "C"
57 {
58 #endif
59 
60 
61 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddMultiplePeopleParameters (ParameterSet *param_set_p, const char *group_s, LinkedList *existing_people_p, FieldTrialServiceData *data_p);
62 
63 
65 
66 
67 DFW_FIELD_TRIAL_SERVICE_LOCAL OperationStatus ProcessPeople (ServiceJob *job_p, ParameterSet *param_set_p, bool (*process_person_fn) (Person *person_p, void *user_data_p), void *user_data_p, FieldTrialServiceData *ft_service_data_p);
68 
69 
70 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddPeopleToJSON (LinkedList *people_p, const char * const key_s, json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p);
71 
72 
73 DFW_FIELD_TRIAL_SERVICE_LOCAL OperationStatus AddPeopleFromJSON (const json_t *people_json_p, bool (*add_person_fn) (Person *person_p, void *user_data_p, MEM_FLAG *mem_p), void *user_data_p, const FieldTrialServiceData *service_data_p);
74 
75 
76 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddPeopleAsFrictionlessData (LinkedList *people_p, const char * const key_s, json_t *json_p, const FieldTrialServiceData *data_p);
77 
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 
84 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_PERSON_JOBS_H_ */
AddPeopleToJSON
bool AddPeopleToJSON(LinkedList *people_p, const char *const key_s, json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p)
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
PERSON_JOB_PREFIX
#define PERSON_JOB_PREFIX
Definition: person_jobs.h:42
NamedParameterType
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
parameter_set.h
operation.h
PT_STRING
A c-style string.
Definition: parameter_type.h:58
AddPeopleFromJSON
OperationStatus AddPeopleFromJSON(const json_t *people_json_p, bool(*add_person_fn)(Person *person_p, void *user_data_p, MEM_FLAG *mem_p), void *user_data_p, const FieldTrialServiceData *service_data_p)
dfw_field_trial_service_library.h
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
AddMultiplePeopleParameters
bool AddMultiplePeopleParameters(ParameterSet *param_set_p, const char *group_s, LinkedList *existing_people_p, FieldTrialServiceData *data_p)
LinkedList
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
OperationStatus
OperationStatus
The current status of an Operation.
Definition: operation.h:96
ProcessPeople
OperationStatus ProcessPeople(ServiceJob *job_p, ParameterSet *param_set_p, bool(*process_person_fn)(Person *person_p, void *user_data_p), void *user_data_p, FieldTrialServiceData *ft_service_data_p)
AddPeopleAsFrictionlessData
bool AddPeopleAsFrictionlessData(LinkedList *people_p, const char *const key_s, json_t *json_p, const FieldTrialServiceData *data_p)
PERSON_JOB_STRUCT_VAL
#define PERSON_JOB_STRUCT_VAL(x, y)
Definition: person_jobs.h:44
Person
Definition: person.h:51
dfw_field_trial_service_data.h
linked_list.h
A doubly-linked list.
GetPersonParameterTypeForNamedParameter
bool GetPersonParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
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
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
parameter_group.h
person.h