59 #include "opal_config.h"
103 unsigned opal_tree_sibling_rank;
119 #if OPAL_ENABLE_DEBUG
121 int32_t opal_tree_item_refcount;
286 #if OPAL_ENABLE_DEBUG
288 assert(NULL != tree);
311 #if OPAL_ENABLE_DEBUG
312 assert(NULL != tree);
315 #if OPAL_ENABLE_DEBUG
317 assert(1 == item->opal_tree_item_refcount);
318 assert(tree == item->opal_tree_item_belong_to );
volatile size_t opal_tree_num_items
Quick reference to the number of items in the tree.
Definition: opal_tree.h:183
static opal_tree_item_t * opal_tree_get_root(opal_tree_t *tree)
Return the root item on the tree (does not remove it).
Definition: opal_tree.h:308
struct opal_tree_item_t * opal_tree_first_child
Pointer to first child item, or NULL if there are no children.
Definition: opal_tree.h:115
unsigned opal_tree_num_ancestors
Depth from the root item in tree.
Definition: opal_tree.h:101
static opal_tree_item_t * opal_tree_get_prev_sibling(opal_tree_item_t *item)
Get the previous sibling item in the tree.
Definition: opal_tree.h:233
int(* opal_tree_item_serialize_fn_t)(opal_tree_item_t *item, opal_buffer_t *buffer)
The serialize function typedef.
Definition: opal_tree.h:153
struct opal_tree_t * opal_tree_container
Pointer to the tree this item belongs to.
Definition: opal_tree.h:96
Definition: opal_tree.h:91
unsigned opal_tree_num_children
Number of children.
Definition: opal_tree.h:113
opal_tree_comp_fn_t comp
Function to compare two items in tree.
Definition: opal_tree.h:185
Definition: opal_tree.h:176
opal_tree_item_t opal_tree_sentinel
Guard item of the tree that child points to root.
Definition: opal_tree.h:181
opal_object_t super
Generic parent class for all Open MPI objects.
Definition: opal_tree.h:94
OPAL_DECLSPEC size_t opal_tree_get_size(opal_tree_t *tree)
Return the number of items in a tree.
Definition: opal_tree.c:141
OPAL_DECLSPEC opal_tree_item_t * opal_tree_remove_subtree(opal_tree_item_t *item)
Remove an item and everything below from a tree.
Definition: opal_tree.c:235
OPAL_DECLSPEC opal_tree_item_t * opal_tree_find_with(opal_tree_item_t *item, void *key)
Return the next tree item that matches key provided.
Definition: opal_tree.c:446
opal_tree_item_deserialize_fn_t deserialize
Function to deserialize tree item data.
Definition: opal_tree.h:189
opal_tree_item_serialize_fn_t serialize
Function to serialize tree item data.
Definition: opal_tree.h:187
struct opal_tree_item_t * opal_tree_last_child
Pointer to last child item, or NULL if there are no children.
Definition: opal_tree.h:117
opal_object_t super
Generic parent class for all Open MPI objects.
Definition: opal_tree.h:179
static opal_tree_item_t * opal_tree_get_parent(opal_tree_item_t *item)
Macros to access items in the tree.
Definition: opal_tree.h:203
static opal_tree_item_t * opal_tree_get_next_sibling(opal_tree_item_t *item)
Get the next sibling item in the tree.
Definition: opal_tree.h:217
int(* opal_tree_comp_fn_t)(opal_tree_item_t *item, void *key)
Check to see if item's user specific data matches key.
Definition: opal_tree.h:141
struct opal_tree_item_t * opal_tree_prev_sibling
Pointer to previous item below same parent (or NULL if this is the rightmost sibling) ...
Definition: opal_tree.h:109
OPAL_DECLSPEC void opal_tree_add_child(opal_tree_item_t *parent_item, opal_tree_item_t *new_item)
Add new item as child to its parent item.
Definition: opal_tree.c:170
static opal_tree_item_t * opal_tree_get_first_child(opal_tree_item_t *item)
Get the first child item in the tree.
Definition: opal_tree.h:249
Base object.
Definition: opal_object.h:182
OPAL_DECLSPEC void opal_tree_init(opal_tree_t *tree, opal_tree_comp_fn_t comp, opal_tree_item_serialize_fn_t serialize, opal_tree_item_deserialize_fn_t deserialize)
Initialize tree container; must be called before using the tree.
Definition: opal_tree.c:113
struct opal_tree_item_t * opal_tree_next_sibling
Pointer to next item below same parent (or NULL if this is the leftmost sibling)
Definition: opal_tree.h:106
OPAL_DECLSPEC int opal_tree_deserialize(opal_buffer_t *buffer, opal_tree_item_t *start_item)
De-serialize tree data.
Definition: opal_tree.c:409
static opal_tree_item_t * opal_tree_get_last_child(opal_tree_item_t *item)
Get the last child item in the tree.
Definition: opal_tree.h:265
Structure for holding a buffer to be used with the RML or OOB subsystems.
Definition: dss_types.h:159
struct opal_tree_item_t * opal_tree_parent
Pointer to parent tree item.
Definition: opal_tree.h:99
static bool opal_tree_is_empty(opal_tree_t *tree)
Check for empty tree.
Definition: opal_tree.h:284
Mutual exclusion functions.
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
OPAL_DECLSPEC int opal_tree_serialize(opal_tree_item_t *start_item, opal_buffer_t *buffer)
Serialize tree data.
Definition: opal_tree.c:339
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236
int(* opal_tree_item_deserialize_fn_t)(opal_buffer_t *buffer, opal_tree_item_t **item)
The deserialize function typedef.
Definition: opal_tree.h:167