Coin Logo http://www.sim.no/
http://www.coin3d.org/

rbptree.h
1#ifndef CC_RBPTREE_H
2#define CC_RBPTREE_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <Inventor/C/basic.h>
28
29#include <stdarg.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif /* __cplusplus */
34
35
36typedef struct cc_rbptree_node cc_rbptree_node;
37
38typedef struct cc_rbptree {
39 cc_rbptree_node * root;
40
41 /* store two items inline to avoid allocating memory for small tree */
42 void * inlinepointer[2];
43 void * inlinedata[2];
44 uint32_t counter;
45} cc_rbptree;
46
47void cc_rbptree_init(cc_rbptree * t);
48void cc_rbptree_clean(cc_rbptree * t);
49
50void cc_rbptree_insert(cc_rbptree * t, void * p, void * data);
51SbBool cc_rbptree_remove(cc_rbptree * t, void * p);
52uint32_t cc_rbptree_size(const cc_rbptree * t);
53
54/* traverse all elements */
55typedef void cc_rbptree_traversecb(void * p, void * data, void * closure);
56void cc_rbptree_traverse(const cc_rbptree * t, cc_rbptree_traversecb * func, void * closure);
57
58/* only for debugging */
59void cc_rbptree_debug(const cc_rbptree * t);
60
61#ifdef __cplusplus
62} /* extern "C" */
63#endif /* __cplusplus */
64
65#endif /* ! CC_RBPTREE_H */

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.