Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SbDict.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SBDICT_H
00021 #define COIN_SBDICT_H
00022 
00023 #include <Inventor/SbBasic.h>
00024 #include <stddef.h>
00025 
00026 class SbPList;
00027 class SbDictEntry;
00028 
00029 
00030 class COIN_DLL_API SbDict {
00031 public:
00032   SbDict(const int entries = 251);
00033   SbDict(const SbDict & from);
00034   ~SbDict();
00035 
00036   SbDict & operator=(const SbDict & from);
00037 
00038   void applyToAll(void (* rtn)(unsigned long key, void * value)) const;
00039   void applyToAll(void (* rtn)(unsigned long key, void * value, void * data),
00040                   void * data) const;
00041   void clear(void);
00042 
00043   SbBool enter(const unsigned long key, void * const value);
00044   SbBool find(const unsigned long key, void *& value) const;
00045   void makePList(SbPList & keys, SbPList & values);
00046   SbBool remove(const unsigned long key);
00047 
00048   void setHashingFunction(unsigned long (*func)(const unsigned long key));
00049 
00050 private:
00051   unsigned long (*hashfunc)(const unsigned long key);
00052   int tablesize;
00053   SbDictEntry ** buckets;
00054   SbDictEntry *findEntry(const unsigned long key,
00055                          const unsigned long bucketnum,
00056                          SbDictEntry **prev = (SbDictEntry **) NULL) const;
00057   static void copyval(unsigned long key, void * value, void * data);
00058 
00059 };
00060 
00061 #endif // !COIN_SBDICT_H

Generated at Tue Mar 5 03:31:11 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001