![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef CC_RBPTREE_H 00002 #define CC_RBPTREE_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) by Kongsberg Oil & Gas Technologies. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * ("GPL") version 2 as published by the Free Software Foundation. 00012 * See the file LICENSE.GPL at the root directory of this source 00013 * distribution for additional information about the GNU GPL. 00014 * 00015 * For using Coin with software that can not be combined with the GNU 00016 * GPL, and for taking advantage of the additional benefits of our 00017 * support services, please contact Kongsberg Oil & Gas Technologies 00018 * about acquiring a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/C/basic.h> 00028 00029 #include <stdarg.h> 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif /* __cplusplus */ 00034 00035 00036 typedef struct cc_rbptree_node cc_rbptree_node; 00037 00038 typedef struct cc_rbptree { 00039 cc_rbptree_node * root; 00040 00041 /* store two items inline to avoid allocating memory for small tree */ 00042 void * inlinepointer[2]; 00043 void * inlinedata[2]; 00044 uint32_t counter; 00045 } cc_rbptree; 00046 00047 void cc_rbptree_init(cc_rbptree * t); 00048 void cc_rbptree_clean(cc_rbptree * t); 00049 00050 void cc_rbptree_insert(cc_rbptree * t, void * p, void * data); 00051 SbBool cc_rbptree_remove(cc_rbptree * t, void * p); 00052 uint32_t cc_rbptree_size(const cc_rbptree * t); 00053 00054 /* traverse all elements */ 00055 typedef void cc_rbptree_traversecb(void * p, void * data, void * closure); 00056 void cc_rbptree_traverse(const cc_rbptree * t, cc_rbptree_traversecb * func, void * closure); 00057 00058 /* only for debugging */ 00059 void cc_rbptree_debug(const cc_rbptree * t); 00060 00061 #ifdef __cplusplus 00062 } /* extern "C" */ 00063 #endif /* __cplusplus */ 00064 00065 #endif /* ! CC_RBPTREE_H */
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Fri Dec 11 2015 03:24:52 for Coin by Doxygen 1.7.6.1.