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.
row.h File Reference
#include "bson/bson.h"
#include "dfw_field_trial_service_library.h"
#include "plot.h"
Include dependency graph for row.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Row
 
struct  RowNode
 

Enumerations

enum  RowType { RT_STANDARD, RT_DISCARD, RT_BLANK, RT_NUM_VALUES }
 

Functions

const BASE_ROW_PREFIX char *RO_ID_S BASE_ROW_VAL ("id")
 
const BASE_ROW_PREFIX char *RO_STUDY_INDEX_S BASE_ROW_VAL ("study_index")
 
const BASE_ROW_PREFIX char *RO_PLOT_ID_S BASE_ROW_VAL ("plot_id")
 
const BASE_ROW_PREFIX char *RO_STUDY_ID_S BASE_ROW_VAL ("study_id")
 
const BASE_ROW_PREFIX char *RO_DISCARD_S BASE_ROW_VAL ("discard")
 
const BASE_ROW_PREFIX char *RO_BLANK_S BASE_ROW_VAL ("blank")
 
const BASE_ROW_PREFIX char *RO_ROW_TYPE_S BASE_ROW_VAL ("row_type")
 
RowAllocateDiscardRow (bson_oid_t *id_p, const uint32 study_index, Plot *parent_plot_p)
 
RowAllocateBaseRow (bson_oid_t *id_p, const uint32 study_index, Plot *parent_plot_p, RowType rt, void(*clear_fn)(Row *row_p), bool(*add_to_json_fn)(const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p), bool(*add_from_json_fn)(Row *row_p, const json_t *row_json_p, const FieldTrialServiceData *data_p), bool(*add_to_fd_fn)(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s))
 
bool InitRow (Row *row_p, bson_oid_t *id_p, const uint32 study_index, Plot *parent_plot_p, RowType rt, void(*clear_fn)(Row *row_p), bool(*add_to_json_fn)(const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p), bool(*add_from_json_fn)(Row *row_p, const json_t *row_json_p, const FieldTrialServiceData *data_p), bool(*add_to_fd_fn)(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s))
 
void ClearRow (Row *row_p)
 
void FreeRow (Row *row_p)
 
RowNodeAllocateRowNode (Row *row_p)
 
void FreeRowNode (ListItem *node_p)
 
void SetRowType (Row *row_p, RowType rt)
 
RowType GetRowType (const Row *row_p)
 
bool AddRowToJSON (const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p)
 
RowGetRowFromJSON (const json_t *json_p, Plot *plot_p, const Study *study_p, const ViewFormat format, FieldTrialServiceData *data_p)
 
bool PopulateRowFromJSON (Row *row_p, Plot *plot_p, const json_t *row_json_p, const ViewFormat format, FieldTrialServiceData *data_p)
 
json_t * GetRowAsJSON (const Row *row_p, const ViewFormat format, JSONProcessor *processor_p, const FieldTrialServiceData *data_p)
 
bool SetRowTypeFromJSON (RowType *rt_p, const json_t *row_json_p)
 
const char * GetRowTypeAsString (const RowType rt)
 
bool SetRowTypeFromString (RowType *rt_p, const char *value_s)
 
void SetRowCallbackFunctions (Row *row_p, void(*clear_fn)(Row *row_p), bool(*add_to_json_fn)(const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p), bool(*add_from_json_fn)(Row *row_p, const json_t *row_json_p, const FieldTrialServiceData *data_p), bool(*add_to_fd_fn)(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s))
 

Enumeration Type Documentation

◆ RowType

enum RowType
Enumerator
RT_STANDARD 

A normal plot which is part of an experiment.

RT_DISCARD 

A physical plot where no measurements are taken, just there as a physical spacer which will appear in the plot-based view.

RT_BLANK 

Used to keep the stylised view when laying out the plots and you have non-regular gaps.

Grassroots won't draw these plots and will use them for gaps calculations and draw gaps instead

RT_NUM_VALUES 

The number of different values that a RowType can take.

Function Documentation

◆ BASE_ROW_VAL() [1/7]

const BASE_ROW_PREFIX char* RO_ID_S BASE_ROW_VAL ( "id"  )

◆ BASE_ROW_VAL() [2/7]

const BASE_ROW_PREFIX char* RO_STUDY_INDEX_S BASE_ROW_VAL ( "study_index"  )

◆ BASE_ROW_VAL() [3/7]

const BASE_ROW_PREFIX char* RO_PLOT_ID_S BASE_ROW_VAL ( "plot_id"  )

◆ BASE_ROW_VAL() [4/7]

const BASE_ROW_PREFIX char* RO_STUDY_ID_S BASE_ROW_VAL ( "study_id"  )

◆ BASE_ROW_VAL() [5/7]

const BASE_ROW_PREFIX char* RO_DISCARD_S BASE_ROW_VAL ( "discard"  )

◆ BASE_ROW_VAL() [6/7]

const BASE_ROW_PREFIX char* RO_BLANK_S BASE_ROW_VAL ( "blank"  )

◆ BASE_ROW_VAL() [7/7]

const BASE_ROW_PREFIX char* RO_ROW_TYPE_S BASE_ROW_VAL ( "row_type"  )

◆ AllocateDiscardRow()

Row* AllocateDiscardRow ( bson_oid_t *  id_p,
const uint32  study_index,
Plot parent_plot_p 
)

◆ AllocateBaseRow()

Row* AllocateBaseRow ( bson_oid_t *  id_p,
const uint32  study_index,
Plot parent_plot_p,
RowType  rt,
void(*)(Row *row_p)  clear_fn,
bool(*)(const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p)  add_to_json_fn,
bool(*)(Row *row_p, const json_t *row_json_p, const FieldTrialServiceData *data_p)  add_from_json_fn,
bool(*)(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)  add_to_fd_fn 
)

◆ InitRow()

bool InitRow ( Row row_p,
bson_oid_t *  id_p,
const uint32  study_index,
Plot parent_plot_p,
RowType  rt,
void(*)(Row *row_p)  clear_fn,
bool(*)(const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p)  add_to_json_fn,
bool(*)(Row *row_p, const json_t *row_json_p, const FieldTrialServiceData *data_p)  add_from_json_fn,
bool(*)(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)  add_to_fd_fn 
)

◆ ClearRow()

void ClearRow ( Row row_p)

◆ FreeRow()

void FreeRow ( Row row_p)

◆ AllocateRowNode()

RowNode* AllocateRowNode ( Row row_p)

◆ FreeRowNode()

void FreeRowNode ( ListItem node_p)

◆ SetRowType()

void SetRowType ( Row row_p,
RowType  rt 
)

◆ GetRowType()

RowType GetRowType ( const Row row_p)

◆ AddRowToJSON()

bool AddRowToJSON ( const Row row_p,
json_t *  row_json_p,
const ViewFormat  format,
const FieldTrialServiceData data_p 
)

◆ GetRowFromJSON()

Row* GetRowFromJSON ( const json_t *  json_p,
Plot plot_p,
const Study study_p,
const ViewFormat  format,
FieldTrialServiceData data_p 
)

◆ PopulateRowFromJSON()

bool PopulateRowFromJSON ( Row row_p,
Plot plot_p,
const json_t *  row_json_p,
const ViewFormat  format,
FieldTrialServiceData data_p 
)

◆ GetRowAsJSON()

json_t* GetRowAsJSON ( const Row row_p,
const ViewFormat  format,
JSONProcessor processor_p,
const FieldTrialServiceData data_p 
)

◆ SetRowTypeFromJSON()

bool SetRowTypeFromJSON ( RowType rt_p,
const json_t *  row_json_p 
)

◆ GetRowTypeAsString()

const char* GetRowTypeAsString ( const RowType  rt)

◆ SetRowTypeFromString()

bool SetRowTypeFromString ( RowType rt_p,
const char *  value_s 
)

◆ SetRowCallbackFunctions()

void SetRowCallbackFunctions ( Row row_p,
void(*)(Row *row_p)  clear_fn,
bool(*)(const Row *row_p, json_t *row_json_p, const ViewFormat format, const FieldTrialServiceData *data_p)  add_to_json_fn,
bool(*)(Row *row_p, const json_t *row_json_p, const FieldTrialServiceData *data_p)  add_from_json_fn,
bool(*)(const Row *row_p, json_t *row_fd_p, const FieldTrialServiceData *service_data_p, const char *const null_sequence_s)  add_to_fd_fn 
)