avl_Destroy.cpp.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/* $Id$ */
/** @file
* kAVLDestroy - Walk the tree calling a callback to destroy all the nodes.
*/
/*
* Copyright (C) 1999-2004 knut st. osmundsen (bird-src-spam@anduin.net)
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef _kAVLDestroy_h_
#define _kAVLDestroy_h_
/**
* Iterates thru all nodes in the given tree so the caller can free resources
* associated with each node.
*
* @returns 0 on success.
* @returns Return code from the callback on failure. The tree might be half
* destroyed at this point and will not behave correctly when any
* insert or remove operation is attempted.
*
* @param ppTree Pointer to the AVL-tree root node pointer.
* @param pfnCallBack Pointer to callback function.
* @param pvParam User parameter passed on to the callback function.
*/
{
return 0;
{
int rc;
{
/* push left and recurse */
{
continue;
}
}
/* pop pNode */
/* push right */
{
}
/* call destructor */
if (rc)
return rc;
} /* while */
return 0;
}
#endif