libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_nary_tree.h File Reference

Go to the source code of this file.

Data Structures

struct  GblNaryTreeNode
 

Macros

#define GBL_NARY_TREE_NPOS
 
#define GBL_NARY_TREE_ENTRY(node, structure, field)
 
#define GBL_NARY_TREE_TRAVERSAL_MASK(order, flags)
 

Typedefs

typedef GblBool(* GblNaryTreeIterFn) (const GblNaryTreeNode *pNode, void *pUd)
 

Enumerations

enum  GBL_NARY_TREE_NODE_FLAGS
 
enum  GBL_NARY_TREE_TRAVERSAL_ORDER
 

Functions

size_t GblNaryTree_depth (const GblNaryTreeNode *pSelf)
 
GblFlags GblNaryTree_flags (const GblNaryTreeNode *pSelf)
 
GblBool GblNaryTree_isConnected (const GblNaryTreeNode *pSelf)
 
GblBool GblNaryTree_isRoot (const GblNaryTreeNode *pSelf)
 
GblBool GblNaryTree_isInternal (const GblNaryTreeNode *pSelf)
 
GblBool GblNaryTree_isLeaf (const GblNaryTreeNode *pSelf)
 
GblBool GblNaryTree_isParent (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
GblBool GblNaryTree_isAncestor (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
GblBool GblNaryTree_isSibling (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
GblBool GblNaryTree_isChild (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
GblBool GblNaryTree_isDescendent (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
size_t GblNaryTree_childCount (const GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_childLast (const GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_childBefore (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pChild)
 
GblNaryTreeNodeGblNaryTree_childAt (const GblNaryTreeNode *pSelf, size_t index)
 
size_t GblNaryTree_childIndex (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pChild)
 
void GblNaryTree_addChildFront (GblNaryTreeNode *pSelf, GblNaryTreeNode *pChild)
 
void GblNaryTree_addChildBack (GblNaryTreeNode *pSelf, GblNaryTreeNode *pChild)
 
void GblNaryTree_addChildTo (GblNaryTreeNode *pSelf, size_t index, GblNaryTreeNode *pChild)
 
void GblNaryTree_addChildBefore (GblNaryTreeNode *pSelf, GblNaryTreeNode *pBefore, GblNaryTreeNode *pChild)
 
void GblNaryTree_addChildAfter (GblNaryTreeNode *pSelf, GblNaryTreeNode *pAfter, GblNaryTreeNode *pChild)
 
void GblNaryTree_moveChildFront (GblNaryTreeNode *pSelf, GblNaryTreeNode *pChild)
 
void GblNaryTree_moveChildBack (GblNaryTreeNode *pSelf, GblNaryTreeNode *pChild)
 
void GblNaryTree_moveChildTo (GblNaryTreeNode *pSelf, size_t index, GblNaryTreeNode *pChild)
 
GblNaryTreeNodeGblNaryTree_removeChild (GblNaryTreeNode *pSelf, GblNaryTreeNode *pChild)
 
GblNaryTreeNodeGblNaryTree_removeChildFront (GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_removeChildBack (GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_removeChildAt (GblNaryTreeNode *pSelf, size_t index)
 
void GblNaryTree_replaceChild (GblNaryTreeNode *pSelf, GblNaryTreeNode *pOld, GblNaryTreeNode *pNew)
 
void GblNaryTree_replaceChildAt (GblNaryTreeNode *pSelf, size_t index, GblNaryTreeNode *pNewChild)
 
void GblNaryTree_swapChildren (GblNaryTreeNode *pSelf, GblNaryTreeNode *pChild1, GblNaryTreeNode *pChild2)
 
void GblNaryTree_swapChildrenAt (GblNaryTreeNode *pSelf, size_t index1, size_t index2)
 
void GblNaryTree_reverseChildren (GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_root (GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_base (GblNaryTreeNode *pSelf, size_t depth)
 
GblNaryTreeNodeGblNaryTree_ancestor (const GblNaryTreeNode *pSelf, size_t height)
 
size_t GblNaryTree_ancestorHeight (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pParent)
 
size_t GblNaryTree_siblingCount (const GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_siblingLast (const GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_siblingBefore (const GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_siblingFirst (const GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_siblingAt (const GblNaryTreeNode *pSelf, size_t index)
 
size_t GblNaryTree_siblingIndex (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
void GblNaryTree_disconnect (GblNaryTreeNode *pSelf)
 
GblNaryTreeNodeGblNaryTree_lowestCommonAncestor (const GblNaryTreeNode *pSelf, const GblNaryTreeNode *pOther)
 
GblBool GblNaryTree_traverse (const GblNaryTreeNode *pSelf, GblFlags mask, GblNaryTreeIterFn pFnIt, void *pUd)
 
GblBool GblNaryTree_traverseInOrder (const GblNaryTreeNode *pSelf, GblFlags mask, GblNaryTreeIterFn pFnIter, void *pUd)
 
GblBool GblNaryTree_traversePreOrder (const GblNaryTreeNode *pSelf, GblFlags mask, GblNaryTreeIterFn pFnIter, void *pUd)
 
GblBool GblNaryTree_traversePostOrder (const GblNaryTreeNode *pSelf, GblFlags mask, GblNaryTreeIterFn pFnIter, void *pUd)
 

Detailed Description

GblNaryTreeNode structure and related functions.

Todo:
Finish implementing commented out API operations
Author
Falco Girgis

Definition in file gimbal_nary_tree.h.

Macro Definition Documentation

◆ GBL_NARY_TREE_NPOS

#define GBL_NARY_TREE_NPOS

Definition at line 14 of file gimbal_nary_tree.h.

◆ GBL_NARY_TREE_ENTRY

#define GBL_NARY_TREE_ENTRY (   node,
  structure,
  field 
)

Definition at line 15 of file gimbal_nary_tree.h.

◆ GBL_NARY_TREE_TRAVERSAL_MASK

#define GBL_NARY_TREE_TRAVERSAL_MASK (   order,
  flags 
)

Definition at line 16 of file gimbal_nary_tree.h.

Typedef Documentation

◆ GblNaryTreeIterFn

typedef GblBool(* GblNaryTreeIterFn) (const GblNaryTreeNode *pNode, void *pUd)

Definition at line 24 of file gimbal_nary_tree.h.

Enumeration Type Documentation

◆ GBL_NARY_TREE_NODE_FLAGS

enum GBL_NARY_TREE_NODE_FLAGS

Definition at line 26 of file gimbal_nary_tree.h.

26 {
27 GBL_NARY_TREE_NODE_FLAG_ROOT = 0x1,
28 GBL_NARY_TREE_NODE_FLAG_INTERNAL = 0x2,
29 GBL_NARY_TREE_NODE_FLAG_LEAF = 0x4,
30 GBL_NARY_TREE_NODE_FLAGS_ALL = 0x7
31} GBL_NARY_TREE_NODE_FLAGS;

◆ GBL_NARY_TREE_TRAVERSAL_ORDER

enum GBL_NARY_TREE_TRAVERSAL_ORDER

Definition at line 33 of file gimbal_nary_tree.h.

33 {
34 GBL_NARY_TREE_TRAVERSAL_ORDER_PRE,
35 GBL_NARY_TREE_TRAVERSAL_ORDER_IN,
36 GBL_NARY_TREE_TRAVERSAL_ORDER_POST,
37 GBL_NARY_TREE_TRAVERSAL_ORDER_LEVEL
38} GBL_NARY_TREE_TRAVERSAL_ORDER;