XanNode Struct Reference

Node of a generic tree. More...

#include <xanlib.h>

Collaboration diagram for XanNode:
Collaboration graph
[legend]

Data Fields

XanListchildrens
void * data
struct XanNodeparent
sem_t mutex
void *(* alloc )(size_t size)
void(* free )(void *address)
void *(* clone )(void *data)
struct XanNode *(* synchGetParent )(struct XanNode *node)
struct XanNode *(* synchGetNextChildren )(struct XanNode *node, struct XanNode *child)
struct XanNode *(* synchAddNewChildren )(struct XanNode *node, void *childData)
struct XanNode *(* synchCloneTree )(struct XanNode *node)
void(* synchAddChildren )(struct XanNode *node, struct XanNode *child)
void(* synchDeleteChildren )(struct XanNode *node, struct XanNode *child)
void(* synchSetParent )(struct XanNode *node, struct XanNode *parent)
void(* synchSetData )(struct XanNode *node, void *data)
void *(* synchGetData )(struct XanNode *node)
XanList *(* synchGetChildrens )(struct XanNode *node)
void(* synchSetCloneFunction )(struct XanNode *node, void *(*cloneFunction)(void *data))
void(* synchDestroyTree )(struct XanNode *node)
void(* synchDestroyTreeAndData )(struct XanNode *node)
XanList *(* synchToPreOrderList )(struct XanNode *rootNode)
XanList *(* synchToPostOrderList )(struct XanNode *rootNode)
XanList *(* synchToInOrderList )(struct XanNode *rootNode)
struct XanNode *(* synchFind )(struct XanNode *rootNode, void *data)
struct XanNode *(* getParent )(struct XanNode *node)
struct XanNode *(* getNextChildren )(struct XanNode *node, struct XanNode *child)
struct XanNode *(* addNewChildren )(struct XanNode *node, void *childData)
struct XanNode *(* cloneTree )(struct XanNode *node)
void(* addChildren )(struct XanNode *node, struct XanNode *child)
void(* deleteChildren )(struct XanNode *node, struct XanNode *child)
void(* setParent )(struct XanNode *node, struct XanNode *parent)
void(* setData )(struct XanNode *node, void *data)
void *(* getData )(struct XanNode *node)
XanList *(* getChildrens )(struct XanNode *node)
void(* setCloneFunction )(struct XanNode *node, void *(*cloneFunction)(void *data))
void(* destroyTree )(struct XanNode *node)
void(* destroyNode )(struct XanNode *node)
void(* destroyTreeAndData )(struct XanNode *node)
XanList *(* toPreOrderList )(struct XanNode *rootNode)
XanList *(* toPostOrderList )(struct XanNode *rootNode)
XanList *(* toInOrderList )(struct XanNode *rootNode)
struct XanNode *(* find )(struct XanNode *rootNode, void *data)

Detailed Description

Node of a generic tree.

The XanNode structure implements a generic N-ary tree.

Definition at line 259 of file xanlib.h.


Field Documentation

void(* XanNode::addChildren)(struct XanNode *node, struct XanNode *child)

Add the node given as input to the childrens of the current one.

Definition at line 294 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::addNewChildren)(struct XanNode *node, void *childData) [read]

Make a new XanNode struct which stores inside itself the childData parameter, before returning it, it adds this new node to the list of childrens of the node.

Definition at line 292 of file xanlib.h.

Referenced by xanNodeNew().

void*(* XanNode::alloc)(size_t size)
void*(* XanNode::clone)(void *data)
struct XanNode*(* XanNode::cloneTree)(struct XanNode *node) [read]

Return a clone of the tree; each element stored inside each node of the tree rooted to the current one is cloned by calling the cloning function of the node.

Definition at line 293 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::deleteChildren)(struct XanNode *node, struct XanNode *child)

Delete the children given as input from the list of childrens of the current node.

Definition at line 295 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::destroyNode)(struct XanNode *node)

Destroy the node given as input

Definition at line 302 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::destroyTree)(struct XanNode *node)

Destroy the tree rooted to the current node

Definition at line 301 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::destroyTreeAndData)(struct XanNode *node)

Destroy the tree rooted to the current node, freeing the data stored inside each element of this tree calling the free function of the current node.

Definition at line 303 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::find)(struct XanNode *rootNode, void *data) [read]

Find the value `data` inside the tree rooted from rootNode.

Definition at line 307 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::free)(void *address)

Return the list of childrens of the current node.

Definition at line 299 of file xanlib.h.

Referenced by xanNodeNew().

void*(* XanNode::getData)(struct XanNode *node)

Return the data stored inside the current node.

Definition at line 298 of file xanlib.h.

Referenced by internalInOrderListHelpFunction(), internalPostOrderListHelpFunction(), and xanNodeNew().

struct XanNode*(* XanNode::getNextChildren)(struct XanNode *node, struct XanNode *child) [read]

Return the next children of the one given as input. If the child parameter is NULL, then it returns the first child of the node.

Definition at line 291 of file xanlib.h.

Referenced by _xanNodeCloneTree(), _xanNodeFind(), _xanNodeGetParent(), internalInOrderListHelpFunction(), internalPostOrderListHelpFunction(), internalPreOrderListHelpFunction(), and xanNodeNew().

struct XanNode*(* XanNode::getParent)(struct XanNode *node) [read]

Return the parent of the node. If this node has no parent, then returns a NULL pointer.

Definition at line 290 of file xanlib.h.

Referenced by xanNodeNew().

Definition at line 264 of file xanlib.h.

Referenced by _xanNodeGetParent(), _xanNodeSetParent(), and xanNodeNew().

void(* XanNode::setCloneFunction)(struct XanNode *node, void *(*cloneFunction)(void *data))

Set the clone function of the current node.

Definition at line 300 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::setData)(struct XanNode *node, void *data)

Set the data stored inside the current node.

Definition at line 297 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::setParent)(struct XanNode *node, struct XanNode *parent)

Set the node given as input as the parent of the current one.

Definition at line 296 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::synchAddChildren)(struct XanNode *node, struct XanNode *child)

Add the node given as input to the childrens of the current one. This operation is act only after taked the lock to the tree.

Definition at line 275 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::synchAddNewChildren)(struct XanNode *node, void *childData) [read]

Make a new XanNode struct which stores inside itself the childData parameter, before returning it, it adds this new node to the list of childrens of the node. This operation is act only after taked the lock to the tree.

Definition at line 273 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::synchCloneTree)(struct XanNode *node) [read]

Return a clone of the tree; each element stored inside each node of the tree rooted to the current one is cloned by calling the cloning function of the node. This operation is act only after taked the lock to the tree.

Definition at line 274 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::synchDeleteChildren)(struct XanNode *node, struct XanNode *child)

Delete the children given as input from the list of childrens of the current node. This operation is act only after taked the lock to the tree.

Definition at line 276 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::synchDestroyTree)(struct XanNode *node)

Destroy the tree rooted to the current node

Definition at line 282 of file xanlib.h.

Referenced by xanNodeNew().

Destroy the tree rooted to the current node, freeing the data stored inside each element of this tree calling the free function of the current node. This operation is act only after taked the lock to the tree.

Definition at line 283 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::synchFind)(struct XanNode *rootNode, void *data) [read]

Find the value `data` inside the tree rooted from rootNode. This operation is act only after taked the lock to the tree.

Definition at line 287 of file xanlib.h.

Referenced by xanNodeNew().

Return the list of childrens of the current node. This operation is act only after taked the lock to the tree.

Definition at line 280 of file xanlib.h.

Referenced by xanNodeNew().

void*(* XanNode::synchGetData)(struct XanNode *node)

Return the data stored inside the current node. This operation is act only after taked the lock to the tree.

Definition at line 279 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::synchGetNextChildren)(struct XanNode *node, struct XanNode *child) [read]

Return the next children of the one given as input. If the child parameter is NULL, then it returns the first child of the node. This operation is act only after taked the lock to the tree.

Definition at line 272 of file xanlib.h.

Referenced by xanNodeNew().

struct XanNode*(* XanNode::synchGetParent)(struct XanNode *node) [read]

Return the parent of the node. If this node has no parent, then returns a NULL pointer. This operation is act only after taked the lock to the tree.

Definition at line 271 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::synchSetCloneFunction)(struct XanNode *node, void *(*cloneFunction)(void *data))

Set the clone function of the current node. This operation is act only after taked the lock to the tree.

Definition at line 281 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::synchSetData)(struct XanNode *node, void *data)

Set the data stored inside the current node. This operation is act only after taked the lock to the tree.

Definition at line 278 of file xanlib.h.

Referenced by xanNodeNew().

void(* XanNode::synchSetParent)(struct XanNode *node, struct XanNode *parent)

Set the node given as input as the parent of the current one. This operation is act only after taked the lock to the tree.

Definition at line 277 of file xanlib.h.

Referenced by xanNodeNew().

Convert the tree rooted at rootNode to the in-order list. This operation is act only after taked the lock to the tree.

Definition at line 286 of file xanlib.h.

Referenced by xanNodeNew().

Convert the tree rooted at rootNode to the post-order list. This operation is act only after taked the lock to the tree.

Definition at line 285 of file xanlib.h.

Referenced by xanNodeNew().

Convert the tree rooted at rootNode to the pre-order list. This operation is act only after taked the lock to the tree.

Definition at line 284 of file xanlib.h.

Referenced by xanNodeNew().

XanList*(* XanNode::toInOrderList)(struct XanNode *rootNode)

Convert the tree rooted at rootNode to the in-order list. Each element of the list has the same type as `data`.

Definition at line 306 of file xanlib.h.

Referenced by xanNodeNew().

XanList*(* XanNode::toPostOrderList)(struct XanNode *rootNode)

Convert the tree rooted at rootNode to the post-order list. Each element of the list has the same type as `data`.

Definition at line 305 of file xanlib.h.

Referenced by xanNodeNew().

XanList*(* XanNode::toPreOrderList)(struct XanNode *rootNode)

Convert the tree rooted at rootNode to the pre-order list. Each element of the list has the same type as `data`.

Definition at line 304 of file xanlib.h.

Referenced by xanNodeNew().


The documentation for this struct was generated from the following file:
Generated on Mon Apr 26 15:54:47 2010 for xanlib by  doxygen 1.6.3