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.
location.h File Reference
#include "study.h"
#include "jansson.h"
#include "address.h"
Include dependency graph for location.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Location
 
struct  LocationNode
 

Enumerations

enum  LocationType { LT_UNKNOWN, LT_FARM, LT_SITE, LT_NUM_TYPES }
 

Functions

const LOCATION_PREFIX char *LO_ADDRESS_S LOCATION_VAL ("address")
 
const LOCATION_PREFIX char *LO_ORDER_S LOCATION_VAL ("order")
 
const LOCATION_PREFIX char *LO_NAME_S LOCATION_VAL ("name")
 
const LOCATION_PREFIX char *LO_SOIL_S LOCATION_VAL ("soil")
 
const LOCATION_PREFIX char *LO_MIN_PH_S LOCATION_VAL ("min_ph")
 
const LOCATION_PREFIX char *LO_MAX_PH_S LOCATION_VAL ("max_ph")
 
const LOCATION_PREFIX char *LO_TYPE_S LOCATION_VAL ("type")
 
const LOCATION_PREFIX char *LT_FARM_S LOCATION_VAL ("farm")
 
const LOCATION_PREFIX char *LT_SITE_S LOCATION_VAL ("site")
 
const LOCATION_PREFIX char *LT_UNKNOWN_S LOCATION_VAL ("unknown")
 
LocationAllocateLocation (Address *address_p, const uint32 order, const char *soil_s, const double64 *min_ph_p, const double64 *max_ph_p, const LocationType loc_type, bson_oid_t *id_p)
 
void FreeLocation (Location *location_p)
 
LocationNodeAllocateLocationNode (Location *location_p)
 
void FreeLocationNode (ListItem *node_p)
 
json_t * GetLocationAsJSON (Location *location_p)
 
LocationGetLocationFromJSON (const json_t *location_json_p, const FieldTrialServiceData *data_p)
 
char * GetLocationAsString (const Location *location_p)
 
LocationGetLocationById (bson_oid_t *id_p, const ViewFormat format, const FieldTrialServiceData *data_p)
 
LocationGetLocationByIdString (const char *location_id_s, const ViewFormat format, const FieldTrialServiceData *data_p)
 
LocationGetUniqueLocationBySearchString (const char *location_s, const ViewFormat format, const FieldTrialServiceData *data_p)
 
LinkedListGetLocationsByName (FieldTrialServiceData *data_p, const char *location_s)
 
OperationStatus SaveLocation (Location *location_p, ServiceJob *job_p, FieldTrialServiceData *data_p)
 
const char * GetLocationTypeAsString (const LocationType loc_type)
 
bool GetLocationTypeFromString (const char *loc_type_s, LocationType *loc_type_p)
 

Enumeration Type Documentation

◆ LocationType

Enumerator
LT_UNKNOWN 
LT_FARM 
LT_SITE 
LT_NUM_TYPES 

Function Documentation

◆ LOCATION_VAL() [1/10]

const LOCATION_PREFIX char* LO_ADDRESS_S LOCATION_VAL ( "address"  )

◆ LOCATION_VAL() [2/10]

const LOCATION_PREFIX char* LO_ORDER_S LOCATION_VAL ( "order"  )

◆ LOCATION_VAL() [3/10]

const LOCATION_PREFIX char* LO_NAME_S LOCATION_VAL ( "name"  )

◆ LOCATION_VAL() [4/10]

const LOCATION_PREFIX char* LO_SOIL_S LOCATION_VAL ( "soil"  )

◆ LOCATION_VAL() [5/10]

const LOCATION_PREFIX char* LO_MIN_PH_S LOCATION_VAL ( "min_ph"  )

◆ LOCATION_VAL() [6/10]

const LOCATION_PREFIX char* LO_MAX_PH_S LOCATION_VAL ( "max_ph"  )

◆ LOCATION_VAL() [7/10]

const LOCATION_PREFIX char* LO_TYPE_S LOCATION_VAL ( "type"  )

◆ LOCATION_VAL() [8/10]

const LOCATION_PREFIX char* LT_FARM_S LOCATION_VAL ( "farm"  )

◆ LOCATION_VAL() [9/10]

const LOCATION_PREFIX char* LT_SITE_S LOCATION_VAL ( "site"  )

◆ LOCATION_VAL() [10/10]

const LOCATION_PREFIX char* LT_UNKNOWN_S LOCATION_VAL ( "unknown"  )

◆ AllocateLocation()

Location* AllocateLocation ( Address address_p,
const uint32  order,
const char *  soil_s,
const double64 *  min_ph_p,
const double64 *  max_ph_p,
const LocationType  loc_type,
bson_oid_t *  id_p 
)

◆ FreeLocation()

void FreeLocation ( Location location_p)

◆ AllocateLocationNode()

LocationNode* AllocateLocationNode ( Location location_p)

◆ FreeLocationNode()

void FreeLocationNode ( ListItem node_p)

◆ GetLocationAsJSON()

json_t* GetLocationAsJSON ( Location location_p)

◆ GetLocationFromJSON()

Location* GetLocationFromJSON ( const json_t *  location_json_p,
const FieldTrialServiceData data_p 
)

◆ GetLocationAsString()

char* GetLocationAsString ( const Location location_p)

◆ GetLocationById()

Location* GetLocationById ( bson_oid_t *  id_p,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetLocationByIdString()

Location* GetLocationByIdString ( const char *  location_id_s,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetUniqueLocationBySearchString()

Location* GetUniqueLocationBySearchString ( const char *  location_s,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetLocationsByName()

LinkedList* GetLocationsByName ( FieldTrialServiceData data_p,
const char *  location_s 
)

◆ SaveLocation()

OperationStatus SaveLocation ( Location location_p,
ServiceJob job_p,
FieldTrialServiceData data_p 
)

◆ GetLocationTypeAsString()

const char* GetLocationTypeAsString ( const LocationType  loc_type)

◆ GetLocationTypeFromString()

bool GetLocationTypeFromString ( const char *  loc_type_s,
LocationType loc_type_p 
)