Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::containers::BinaryTree::DumpTree Function
C++
__cdecl TYPELIB_PROC void DumpTree(PTREEROOT root, int (*Dump)( POINTER user, PTRSZVAL key ));

Basically this is meant to dump to a log, if the print function is passed as NULL, then the tree's contents are dumped to the log. It dumps a very cryptic log of how all nodes in the tree are arranged. But by allowing the user to provide a method to log his data and key, the logging is more meaningful based on the application. The basic code for managing trees and nodes works....

   
int ForEachNode( POINTER user, PTRSZVAL key )
{
    // return not 1 to dump to log the internal tree structure
    return 0; // probably did own logging here, so don't log tree internal
}
   
PTREEROOT tree;
   
void f( void )
{
    DumpTree( tree, ForEachNode );
}
   
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!