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.
|
Go to the documentation of this file.
24 #ifndef DFW_FIELD_TRIAL_SERVICE_DFW_UTIL_H_
25 #define DFW_FIELD_TRIAL_SERVICE_DFW_UTIL_H_
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
38 #ifdef ALLOCATE_DFW_UTIL_TAGS
39 #define DFW_UTIL_PREFIX DFW_FIELD_TRIAL_SERVICE_API
40 #define DFW_UTIL_VAL(x) = x
41 #define DFW_UTIL_STRUCT_VAL(x,y) = { x, y}
43 #define DFW_UTIL_PREFIX extern
44 #define DFW_UTIL_VAL(x)
45 #define DFW_UTIL_STRUCT_VAL(x,y)
55 DFW_UTIL_PREFIX
const char *
const FT_DEFAULT_TIMESTAMP_S
DFW_UTIL_VAL(
"current");
58 DFW_UTIL_PREFIX
const char *
const FT_EMPTY_LIST_OPTION_S
DFW_UTIL_VAL(
"<empty>");
60 DFW_UTIL_PREFIX
const char *
const FT_USER_S
DFW_UTIL_VAL(
"user");
62 DFW_UTIL_PREFIX
const char *
const FT_PERMISSIONS_S
DFW_UTIL_VAL(
"permissions");
bool CacheStudy(const char *id_s, const json_t *study_json_p, const FieldTrialServiceData *data_p)
json_t * GetImageObject(const char *image_url_s, const char *thumbnail_url_s)
bool CreateValidDateFromJSON(const json_t *json_p, const char *key_s, struct tm **time_pp)
json_t * GetCachedStudy(const char *id_s, const FieldTrialServiceData *data_p)
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
A datatype to represent a running task.
Definition: service_job.h:72
char * GetFrictionlessDataURL(const char *const name_s, const FieldTrialServiceData *data_p)
FieldTrialDatatype
Definition: dfw_field_trial_service_data.h:40
A c-style string.
Definition: parameter_type.h:58
A datatype representing a URI.
Definition: data_resource.h:40
bool AddValidDateToJSON(struct tm *time_p, json_t *json_p, const char *key_s, const bool add_time_flag)
Definition: json_processor.h:21
LinkedList * SearchObjects(const FieldTrialServiceData *data_p, const FieldTrialDatatype collection_type, const char **keys_ss, const char **values_ss, void(*free_list_item_fn)(ListItem *const item_p), bool(*add_result_to_list_fn)(const json_t *result_p, LinkedList *list_p, const FieldTrialServiceData *service_data_p))
void * GetDFWObjectById(const bson_oid_t *id_p, FieldTrialDatatype collection_type, void *(*get_obj_from_json_fn)(const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p), const ViewFormat format, const FieldTrialServiceData *data_p)
bool AddContext(json_t *data_p)
void * GetVersionedObject(const char *id_s, const char *timestamp_s, const ViewFormat format, const FieldTrialDatatype dt, const FieldTrialServiceData *data_p, void *(*callback_fn)(json_t *json_p, ViewFormat format, const FieldTrialServiceData *data_p))
bool CopyValidInteger(const int32 *src_p, int32 **dest_pp)
char * GetBackupFilename(const char *id_s, const FieldTrialServiceData *data_p)
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
bool AddValidDateAsEpochToJSON(struct tm *time_p, json_t *json_p, const char *key_s)
bool CopyValidReal(const double64 *src_p, double64 **dest_pp)
bool CopyValidUnsignedInteger(const uint32 *src_p, uint32 **dest_pp)
bool FindAndAddResultToServiceJob(const char *id_s, const ViewFormat format, ServiceJob *job_p, JSONProcessor *processor_p, json_t *(get_json_fn)(const char *id_s, const ViewFormat format, JSONProcessor *processor_p, char **name_ss, const FieldTrialServiceData *data_p), const FieldTrialDatatype datatype, const FieldTrialServiceData *data_p)
Definition: string_parameter.h:32
json_t * GetAllJSONVersionsOfObject(const char *id_s, FieldTrialDatatype collection_type, const FieldTrialServiceData *data_p)
void * GetDFWObjectByNamedId(const bson_oid_t *id_p, FieldTrialDatatype collection_type, const char *id_key_s, void *(*get_obj_from_json_fn)(const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p), const ViewFormat format, const FieldTrialServiceData *data_p)
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
bool GetValidUnsignedIntFromJSON(const json_t *study_json_p, const char *key_s, uint32 **value_pp)
const DFW_UTIL_PREFIX char *const FT_DEFAULT_TIMESTAMP_S DFW_UTIL_VAL("current")
bool CopyValidDate(const struct tm *src_p, struct tm **dest_pp)
char * GetStudyHandbookURL(const char *const name_s, const FieldTrialServiceData *data_p)
char * GetFrictionlessDataFilename(const char *const name_s, const FieldTrialServiceData *data_p)
void * GetDFWObjectByNamedIdString(const char *object_id_s, FieldTrialDatatype collection_type, const char *id_key_s, void *(*get_obj_from_json_fn)(const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p), const ViewFormat format, const FieldTrialServiceData *data_p)
void * GetDFWObjectByIdString(const char *object_id_s, FieldTrialDatatype collection_type, void *(*get_obj_from_json_fn)(const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p), const ViewFormat format, const FieldTrialServiceData *data_p)
bool AddImage(json_t *doc_p, const FieldTrialDatatype data_type, const FieldTrialServiceData *data_p)
bool SetUpListParameterFromJSON(const FieldTrialServiceData *data_p, StringParameter *param_p, const char *active_id_s, const char *empty_option_s, const char *name_key_s, json_t *objects_p)
bool GetValidRealFromJSON(const json_t *study_json_p, const char *key_s, double64 **ph_pp)
bool AddDatatype(json_t *doc_p, const FieldTrialDatatype data_type)
bool ClearCachedStudy(const char *id_s, const FieldTrialServiceData *data_p)
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
json_t * GetSpecificJSONVersionOfObject(const char *id_s, const char *timestamp_s, FieldTrialDatatype collection_type, const FieldTrialServiceData *data_p)
char * GetPlotsUploadsFilename(const char *id_s, const FieldTrialServiceData *data_p)
const char * GetStringDefaultValueFromJSON(const char *param_s, const json_t *params_json_p)
bool SetFieldTrialServiceJobURL(ServiceJob *job_p, const char *const url_prefix_s, const char *const id_s)
void * GetVersionedObjectFromResource(DataResource *resource_p, const NamedParameterType param_type, const char **original_id_ss, FieldTrialServiceData *ft_data_p, void *(*get_versioned_obj_fn)(const char *id_s, const char *timestamp_s, const ViewFormat vf, FieldTrialServiceData *ft_data_p), void *(*get_obj_by_id_fn)(const char *id_s, const ViewFormat vf, FieldTrialServiceData *ft_data_p))
DFW_UTIL_PREFIX NamedParameterType FT_TIMESTAMP DFW_UTIL_STRUCT_VAL("PR Timestamp", PT_STRING)
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43