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.
FieldNode Struct Reference

A datatype for storing a value as a string along with the datatype to convert it to. More...

#include <json_util.h>

Inheritance diagram for FieldNode:
[legend]
Collaboration diagram for FieldNode:
[legend]

Public Member Functions

FieldNodeAllocateFieldNode (const char *name_s, const MEM_FLAG mf, json_type field_type)
 Allocate a FieldNode that points to the given json object. More...
 
void FreeFieldNode (ListItem *node_p)
 Free a FieldNode. More...
 
- Public Member Functions inherited from StringListNode
StringListNodeAllocateStringListNode (const char *const str_p, const MEM_FLAG mem_flag)
 Create a new StringListNode. More...
 
bool InitStringListNode (StringListNode *node_p, const char *const value_s, const MEM_FLAG mem_flag)
 Initialise a StringListNode. More...
 
void FreeStringListNode (ListItem *const node_p)
 Free a StringListNode. More...
 
void ClearStringListNode (StringListNode *node_p)
 Clear a StringListNode by deleting its sln_string_s value as appropriate. More...
 
LinkedListAllocateStringLinkedList (void)
 Create a LinkedList designed to hold StringListNodes. More...
 
LinkedListCopyStringLinkedList (const LinkedList *const src_p)
 Make a copy of a LinkedList of StringListNodes. More...
 
char * GetStringLinkedListAsString (const LinkedList *const src_p)
 Get a new string that is the concatenation of all of the entries on a StringLinkedList. More...
 
bool AddStringToStringLinkedList (LinkedList *list_p, const char *const str_p, const MEM_FLAG mem_flag)
 Create and add a new StringListNode to the tail of a LinkedList. More...
 
LinkedListGetUUIDSList (const char *ids_s)
 Create a LinkedList of StringListNodes with each entry being a uuid. More...
 

Data Fields

StringListNode fn_base_node
 The base node. More...
 
json_type fn_type
 This defines the type of the data. More...
 
- Data Fields inherited from StringListNode
ListItem sln_node
 The ListNode. More...
 
char * sln_string_s
 The string value. More...
 
MEM_FLAG sln_string_flag
 How the memory for the string is stored and freed. More...
 
- Data Fields inherited from ListItem
ListItemln_prev_p
 A pointer to the previous ListItem. More...
 
ListItemln_next_p
 A pointer to the next ListItem. More...
 

Detailed Description

A datatype for storing a value as a string along with the datatype to convert it to.

This is used when reading in data where all the values are stored as strings regardless of their actual datatype e.g.

"score": "10"

where score is actually an integer. This datatype is to allow the conversion back to the correct type.

Member Function Documentation

◆ AllocateFieldNode()

FieldNode * AllocateFieldNode ( const char *  name_s,
const MEM_FLAG  mf,
json_type  field_type 
)

Allocate a FieldNode that points to the given json object.

Parameters
name_sThe json object for the newly to point to.
mfThe MEM_FLAG used to store the name of this FieldNode.
field_typeThe type of JSON object that this FieldNode will store.
Returns
A newly-allocated newly or NULL upon error.
See also
FreeFieldNode

◆ FreeFieldNode()

void FreeFieldNode ( ListItem node_p)

Free a FieldNode.

Parameters
node_pThe FieldNode to free.

Field Documentation

◆ fn_base_node

StringListNode fn_base_node

The base node.

◆ fn_type

json_type fn_type

This defines the type of the data.


The documentation for this struct was generated from the following file: