A node composed of a key-value pair, metadata, and child nodes. More...
Public Attributes | |
struct datanode * | first_child |
Beginning of a linked list of child nodes or NULL. | |
char * | key |
String to match during lookup and pathing. | |
struct datanode * | last_child |
End of linked list; NULL iff first_child is NULL. | |
const char * | meta |
Additional information about the node; managed extermally. | |
int | mod_type |
The intended use of the node; managed externally. | |
struct datanode * | next |
Pointer to a sibling node in containing linked list. | |
struct datanode * | parent |
The node's parent; used in pathing and printing. | |
char * | val |
The node's data; assumed string unless val_type negative. | |
int | val_type |
The type of data stored at the node; managed externally. |
A node composed of a key-value pair, metadata, and child nodes.
Use datanode_init and datanode_lookup to create and obtain nodes.
Nodes are always stored in linked lists, hence the pointer to the next element. Strings key and val are assumed to be "owned" by the datanode and will be freed when it is destroyed; never set these to string constants. Other pointers specify the heirachy of nodes and are maintained internally.
Fields mod_type and val_type primarily serve as conveniences to external code. The datanode_read and datanode_write functions optionally map mod_type to and from a character, and all functions ignore the value stored at a node if val_type is negative (needed, for instance, if val is not a string). Both fields default to 0.
Field meta allows external code to denote, e.g., constraints for val. It is copied by reference and never freed, and thus may be set to constant or externally managed strings. Its intended use is for lists of nominal values, numeric bounds, and regexp matching.
Definition at line 71 of file datanode.h.
struct datanode * datanode::first_child |
Beginning of a linked list of child nodes or NULL.
Definition at line 83 of file datanode.h.
Referenced by datanode_copy(), datanode_destroy(), datanode_lookup_expert(), and datanode_write().
char * datanode::key |
String to match during lookup and pathing.
Definition at line 79 of file datanode.h.
Referenced by datanode_copy(), datanode_destroy(), datanode_init(), datanode_lookup_expert(), datanode_read(), GeneralCrossValidator< TLearner >::Run(), and SimpleCrossValidator< TClassifier >::Run().
struct datanode * datanode::last_child |
End of linked list; NULL iff first_child is NULL.
Definition at line 85 of file datanode.h.
Referenced by datanode_lookup_expert().
const char * datanode::meta |
Additional information about the node; managed extermally.
Definition at line 77 of file datanode.h.
Referenced by datanode_copy().
The intended use of the node; managed externally.
Definition at line 73 of file datanode.h.
Referenced by datanode_copy(), datanode_read(), datanode_write(), and fx_copy_module().
struct datanode * datanode::next |
Pointer to a sibling node in containing linked list.
Definition at line 87 of file datanode.h.
Referenced by datanode_copy(), datanode_destroy(), datanode_lookup_expert(), and datanode_write().
struct datanode * datanode::parent |
The node's parent; used in pathing and printing.
Definition at line 89 of file datanode.h.
Referenced by datanode_lookup_expert().
char * datanode::val |
The node's data; assumed string unless val_type negative.
Definition at line 81 of file datanode.h.
Referenced by datanode_copy(), datanode_destroy(), datanode_read(), and datanode_write().
The type of data stored at the node; managed externally.
Definition at line 75 of file datanode.h.
Referenced by datanode_copy(), and datanode_write().