SbDict(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– SbDict(3) β€” the Coin manual, bestie edition πŸ’–

okay so like. you opened the SbDict man page from Coin (section 3, library functions, iykyk) and honestly? you're gonna eat this up. it's a dictionary. keys and values. that's the whole vibe. let's go πŸ¦‹


✨ NAME ✨

SbDict β€” the SbDict class organizes a dictionary of keys and values. periodt. πŸ’…


🌸 SYNOPSIS 🌸

#include <Inventor/SbDict.h>

πŸ‘‘ Public Types

  • typedef uintptr_t Key β€” this is the key type, bestie. it's a uintptr_t. that's the whole tea.

πŸŽ€ Public Member Functions

  • SbDict (const int entries=251)
  • SbDict (const SbDict &from)
  • ~SbDict ()
  • SbDict & operator= (const SbDict &from)
  • void applyToAll (SbDictApplyFunc *rtn) const
  • void applyToAll (SbDictApplyDataFunc *rtn, void *data) const
  • void clear (void)
  • SbBool enter (const Key key, void *const value)
  • SbBool find (const Key key, void *&value) const
  • void makePList (SbPList &keys, SbPList &values)
  • SbBool remove (const Key key)
  • void setHashingFunction (SbDictHashingFunc *func)

πŸ’œ Detailed Description πŸ’œ

The SbDict class organizes a dictionary of keys and values. (yes, it's literally the NAME section again, they said it twice, iconic of them πŸ’€)

It uses hashing to quickly insert and find entries in the dictionary. An entry consists of an unique key and a generic pointer. so like, one key, one pointer, no drama, no cap. ✨


🧚 Constructor & Destructor Documentation 🧚

🌈 SbDict::SbDict (const int entries = 251)

Constructor, with entries specifying the initial number of buckets in the hash list β€” so it needs to be larger than 0. that part is not optional bestie, 0 is not the move πŸ™ˆ

Other than that? no special care needs to be taken in choosing the value, because it is always rounded up to the nearest power of two. so you can just vibe and pick a number, the class will handle the glow-up. πŸ’…

🌈 SbDict::SbDict (const SbDict & from)

Copy constructor. it copies. that's it. that's the whole sentence. 🫢

🌈 SbDict::~SbDict ()

Destructor. the farewell arc. 😭


⭐ Member Function Documentation ⭐

πŸ’– SbDict & SbDict::operator= (const SbDict & from)

Makes a shallow copy of the contents of dictionary from into this dictionary. shallow! not deep! do not come for me, that's literally what the page says. πŸŽ€

πŸ’– void SbDict::applyToAll (SbDictApplyFunc * rtn) const

Applies rtn to all entries in the dictionary. every single one. no entry left behind. πŸ‘‘

πŸ’– void SbDict::applyToAll (SbDictApplyDataFunc * rtn, void * data) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. so basically same energy, extra data param, slay. ✨

πŸ’– void SbDict::clear (void )

Clear all entries in the dictionary. fresh start, clean slate, main character reset. 🌸

πŸ’– SbBool SbDict::enter (const Key key, void *const value)

Inserts a new entry into the dictionary. key should be an unique number, and value is the generic user data.

If key does not exist in the dictionary, a new entry is created and TRUE is returned. Otherwise, the generic user data is changed to value, and FALSE is returned. so like: new key = TRUE + new entry, existing key = FALSE + overwrite. write that down. πŸ“

πŸ’– SbBool SbDict::find (const Key key, void *& value) const

Searches for key in the dictionary. If an entry with this key exists, TRUE is returned and the entry value is returned in value. Otherwise, FALSE is returned. bestie hunting behavior, honestly. πŸ”₯

πŸ’– void SbDict::makePList (SbPList & keys, SbPList & values)

Creates lists with all entries in the dictionary. one list of keys, one list of values. a lil matching set, adorable. πŸŽ€

πŸ’– SbBool SbDict::remove (const Key key)

Removes the entry with key key. TRUE is returned if an entry with this key was present, FALSE otherwise. bye bestie, or... not bye, depending. πŸ’€

πŸ’– void SbDict::setHashingFunction (SbDictHashingFunc * func)

Sets a new hashing function for this dictionary. Default hashing function just returns the key.

If you find that items entered into the dictionary seems to make clusters in only a few buckets, you should try setting a hashing function. If you're for instance using strings, you could use the static SbString::hash() function (you'd need to make a static function that will cast from SbDict::Key to char * of course).

This function is not part of the OIV API. ⚠️ important, don't forget it, fr fr.


🫢 Author 🫢

Generated automatically by Doxygen for Coin from the source code. so like, not a human, a robot, and yet it ate. πŸ’…


and that's the page bestie!! this was SbDict(3) from Coin, Version 4.0.10, dated Thu Jun 25 2026 00:00:00 β€” go forth and hash responsibly, mwah πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from