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.
field_trial.h File Reference
#include "dfw_field_trial_service_data.h"
#include "dfw_field_trial_service_library.h"
#include "jansson.h"
#include "typedefs.h"
#include "linked_list.h"
#include "person.h"
Include dependency graph for field_trial.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FieldTrial
 A datatype that represents a Field Trial that can contain one or more Studies. More...
 
struct  FieldTrialNode
 A datatype for storing a Field Trial on a list. More...
 

Functions

const FIELD_TRIAL_PREFIX char *FT_NAME_S FIELD_TRIAL_CONCAT_VAL (CONTEXT_PREFIX_SCHEMA_ORG_S, "name")
 
FieldTrialAllocateFieldTrial (const char *name_s, const char *team_s, struct Programme *parent_program_p, MEM_FLAG parent_program_mem, bson_oid_t *id_p, const char *time_s)
 
void FreeFieldTrial (FieldTrial *trial_p)
 Free a given FieldTrial. More...
 
FieldTrialNodeAllocateFieldTrialNode (FieldTrial *trial_p)
 
void FreeFieldTrialNode (ListItem *node_p)
 
json_t * GetFieldTrialAsJSON (FieldTrial *trial_p, const ViewFormat format, FieldTrialServiceData *data_p)
 
FieldTrialGetFieldTrialFromJSON (const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p)
 
FieldTrialGetVersionedFieldTrial (const char *field_trial_id_s, const char *timestamp_s, const ViewFormat format, const FieldTrialServiceData *data_p)
 
LinkedListGetFieldTrialStudies (FieldTrial *trial_p)
 
char * GetFieldTrialIdAsString (const FieldTrial *trial_p)
 
FieldTrialGetUniqueFieldTrialBySearchString (const char *trial_s, const ViewFormat format, const FieldTrialServiceData *data_p)
 
bool AddFieldTrialStudy (FieldTrial *trial_p, struct Study *study_p, MEM_FLAG mf)
 
bool AddFieldTrialPerson (FieldTrial *trial_p, Person *person_p, MEM_FLAG mf)
 
bool SaveFieldTrial (FieldTrial *trial_p, ServiceJob *job_p, FieldTrialServiceData *data_p)
 
FieldTrialGetFieldTrialByIdString (const char *field_trial_id_s, const ViewFormat format, const FieldTrialServiceData *data_p)
 
bool GetAllFieldTrialStudies (FieldTrial *trial_p, const ViewFormat format, const FieldTrialServiceData *data_p)
 
char * GetFieldTrialAsString (const FieldTrial *trial_p)
 
bool AddStudiesToFieldTrialJSON (FieldTrial *trial_p, json_t *trial_json_p, const ViewFormat format, FieldTrialServiceData *data_p)
 
bool AddPeopleToFieldTrialJSON (FieldTrial *trial_p, json_t *trial_json_p, const ViewFormat format, FieldTrialServiceData *data_p)
 
LinkedListGetFieldTrialsByName (const char *const trial_s, const FieldTrialServiceData *data_p)
 
FieldTrialGetFieldTrialById (const bson_oid_t *id_p, const ViewFormat format, const FieldTrialServiceData *data_p)
 
bool RemoveFieldTrialStudy (FieldTrial *trial_p, struct Study *study_p)
 Remove a Study from a given FieldTrial. More...
 
uint32 GetNumberOfFieldTrialStudies (const FieldTrial *trial_p)
 Get the number of Studies in a given FieldTrial. More...
 

Variables

const FIELD_TRIAL_PREFIX char * FT_TEAM_S = "team"
 
const FIELD_TRIAL_PREFIX char * FT_ID_S = "_id"
 
const FIELD_TRIAL_PREFIX char * FT_STUDIES_S = "studies"
 
const FIELD_TRIAL_PREFIX char * FT_PEOPLE_S = "people"
 
const FIELD_TRIAL_PREFIX char * FT_PARENT_PROGRAM_S = "parent_program"
 

Function Documentation

◆ FIELD_TRIAL_CONCAT_VAL()

const FIELD_TRIAL_PREFIX char* FT_NAME_S FIELD_TRIAL_CONCAT_VAL ( CONTEXT_PREFIX_SCHEMA_ORG_S  ,
"name"   
)

◆ AllocateFieldTrial()

FieldTrial* AllocateFieldTrial ( const char *  name_s,
const char *  team_s,
struct Programme parent_program_p,
MEM_FLAG  parent_program_mem,
bson_oid_t *  id_p,
const char *  time_s 
)

◆ AllocateFieldTrialNode()

FieldTrialNode* AllocateFieldTrialNode ( FieldTrial trial_p)

◆ FreeFieldTrialNode()

void FreeFieldTrialNode ( ListItem node_p)

◆ GetFieldTrialAsJSON()

json_t* GetFieldTrialAsJSON ( FieldTrial trial_p,
const ViewFormat  format,
FieldTrialServiceData data_p 
)

◆ GetFieldTrialFromJSON()

FieldTrial* GetFieldTrialFromJSON ( const json_t *  json_p,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetVersionedFieldTrial()

FieldTrial* GetVersionedFieldTrial ( const char *  field_trial_id_s,
const char *  timestamp_s,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetFieldTrialStudies()

LinkedList* GetFieldTrialStudies ( FieldTrial trial_p)

◆ GetFieldTrialIdAsString()

char* GetFieldTrialIdAsString ( const FieldTrial trial_p)

◆ GetUniqueFieldTrialBySearchString()

FieldTrial* GetUniqueFieldTrialBySearchString ( const char *  trial_s,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ AddFieldTrialStudy()

bool AddFieldTrialStudy ( FieldTrial trial_p,
struct Study study_p,
MEM_FLAG  mf 
)

◆ AddFieldTrialPerson()

bool AddFieldTrialPerson ( FieldTrial trial_p,
Person person_p,
MEM_FLAG  mf 
)

◆ SaveFieldTrial()

bool SaveFieldTrial ( FieldTrial trial_p,
ServiceJob job_p,
FieldTrialServiceData data_p 
)

◆ GetFieldTrialByIdString()

FieldTrial* GetFieldTrialByIdString ( const char *  field_trial_id_s,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetAllFieldTrialStudies()

bool GetAllFieldTrialStudies ( FieldTrial trial_p,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetFieldTrialAsString()

char* GetFieldTrialAsString ( const FieldTrial trial_p)

◆ AddStudiesToFieldTrialJSON()

bool AddStudiesToFieldTrialJSON ( FieldTrial trial_p,
json_t *  trial_json_p,
const ViewFormat  format,
FieldTrialServiceData data_p 
)

◆ AddPeopleToFieldTrialJSON()

bool AddPeopleToFieldTrialJSON ( FieldTrial trial_p,
json_t *  trial_json_p,
const ViewFormat  format,
FieldTrialServiceData data_p 
)

◆ GetFieldTrialsByName()

LinkedList* GetFieldTrialsByName ( const char *const  trial_s,
const FieldTrialServiceData data_p 
)

◆ GetFieldTrialById()

FieldTrial* GetFieldTrialById ( const bson_oid_t *  id_p,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

Variable Documentation

◆ FT_TEAM_S

const FIELD_TRIAL_PREFIX char* FT_TEAM_S = "team"

◆ FT_ID_S

const FIELD_TRIAL_PREFIX char* FT_ID_S = "_id"

◆ FT_STUDIES_S

const FIELD_TRIAL_PREFIX char* FT_STUDIES_S = "studies"

◆ FT_PEOPLE_S

const FIELD_TRIAL_PREFIX char* FT_PEOPLE_S = "people"

◆ FT_PARENT_PROGRAM_S

const FIELD_TRIAL_PREFIX char* FT_PARENT_PROGRAM_S = "parent_program"