The constructor and destructor are not publicly visible functions.
Fix the indentation. This commit was SVN r28423.
Этот коммит содержится в:
родитель
75cc04faa6
Коммит
92aeefebac
@ -23,11 +23,6 @@
|
||||
|
||||
#include "ompi/class/ompi_rb_tree.h"
|
||||
|
||||
/* declare the instance of the classes */
|
||||
OBJ_CLASS_INSTANCE(ompi_rb_tree_node_t, ompi_free_list_item_t, NULL, NULL);
|
||||
OBJ_CLASS_INSTANCE(ompi_rb_tree_t, opal_object_t, ompi_rb_tree_construct,
|
||||
ompi_rb_tree_destruct);
|
||||
|
||||
/* Private functions */
|
||||
static void btree_insert(ompi_rb_tree_t *tree, ompi_rb_tree_node_t * node);
|
||||
static void btree_delete_fixup(ompi_rb_tree_t *tree, ompi_rb_tree_node_t * x);
|
||||
@ -43,9 +38,14 @@ static void inorder_traversal(ompi_rb_tree_t *tree,
|
||||
ompi_rb_tree_node_t * node);
|
||||
|
||||
|
||||
|
||||
/* constructor */
|
||||
void ompi_rb_tree_construct(opal_object_t * object)
|
||||
/**
|
||||
* the constructor function. creates the free list to get the nodes from
|
||||
*
|
||||
* @param object the tree that is to be used
|
||||
*
|
||||
* @retval NONE
|
||||
*/
|
||||
static void ompi_rb_tree_construct(opal_object_t * object)
|
||||
{
|
||||
ompi_rb_tree_t * tree = (ompi_rb_tree_t *) object;
|
||||
tree->root_ptr = NULL;
|
||||
@ -56,8 +56,12 @@ void ompi_rb_tree_construct(opal_object_t * object)
|
||||
0, -1 , 128, NULL);
|
||||
}
|
||||
|
||||
/* the destructor function */
|
||||
void ompi_rb_tree_destruct(opal_object_t * object)
|
||||
/**
|
||||
* the destructor function. Free the tree and destroys the free list.
|
||||
*
|
||||
* @param object the tree object
|
||||
*/
|
||||
static void ompi_rb_tree_destruct(opal_object_t * object)
|
||||
{
|
||||
if(NULL != ((ompi_rb_tree_t *)object)->root_ptr) {
|
||||
ompi_rb_tree_destroy((ompi_rb_tree_t *) object);
|
||||
@ -66,6 +70,11 @@ void ompi_rb_tree_destruct(opal_object_t * object)
|
||||
return;
|
||||
}
|
||||
|
||||
/* declare the instance of the classes */
|
||||
OBJ_CLASS_INSTANCE(ompi_rb_tree_node_t, ompi_free_list_item_t, NULL, NULL);
|
||||
OBJ_CLASS_INSTANCE(ompi_rb_tree_t, opal_object_t, ompi_rb_tree_construct,
|
||||
ompi_rb_tree_destruct);
|
||||
|
||||
/* Create the tree */
|
||||
int ompi_rb_tree_init(ompi_rb_tree_t * tree,
|
||||
ompi_rb_tree_comp_fn_t comp)
|
||||
|
@ -70,7 +70,7 @@ struct ompi_rb_tree_t {
|
||||
* rather, it points to a sentinal node who's left branch is the real
|
||||
* root of the tree. This is done to eliminate special cases */
|
||||
ompi_rb_tree_node_t * root_ptr;/**< a pointer to the root of the tree */
|
||||
ompi_rb_tree_node_t * nill; /**< the nill sentinal node */
|
||||
ompi_rb_tree_node_t * nill; /**< the nill sentinel node */
|
||||
ompi_rb_tree_comp_fn_t comp; /**< the compare function */
|
||||
ompi_free_list_t free_list; /**< the free list to get the memory from */
|
||||
size_t tree_size; /**< the size of the tree */
|
||||
@ -90,7 +90,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_rb_tree_t);
|
||||
*/
|
||||
typedef int (*ompi_rb_tree_condition_fn_t)(void *);
|
||||
/**
|
||||
* this function is uused for the user to perform any action on the passed
|
||||
* this function is used for the user to perform any action on the passed
|
||||
* values. The first argument is the key and the second is the value.
|
||||
* note that this function SHOULD NOT modify the keys, as that would
|
||||
* mess up the tree.
|
||||
@ -101,22 +101,6 @@ typedef void (*ompi_rb_tree_action_fn_t)(void *, void *);
|
||||
* Public function protoypes
|
||||
*/
|
||||
|
||||
/**
|
||||
* the construct function. creates the free list to get the nodes from
|
||||
*
|
||||
* @param object the tree that is to be used
|
||||
*
|
||||
* @retval NONE
|
||||
*/
|
||||
OMPI_DECLSPEC void ompi_rb_tree_construct(opal_object_t * object);
|
||||
|
||||
/**
|
||||
* the destruct function. tries to free the tree and destroys the free list
|
||||
*
|
||||
* @param object the tree object
|
||||
*/
|
||||
OMPI_DECLSPEC void ompi_rb_tree_destruct(opal_object_t * object);
|
||||
|
||||
/**
|
||||
* the function creates a new tree
|
||||
*
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user