Open Inventor Reference
SbDict Class Reference

This is a dictionary mapping (size_t) integer keys to (void *) data pointers. More...

#include <Inventor/SbDict.h>

Public Member Functions

 SbDict (int entries=251)
 Constructor. More...
 
 ~SbDict ()
 Destructor. More...
 
void applyToAll (void(*rtn)(size_t key, void *value))
 Calls given routine (passing value) for each entry in dictionary. More...
 
void applyToAll (void(*rtn)(size_t key, void *value, void *data), void *data)
 Calls given routine (passing value,data) for each entry in dictionary. More...
 
void clear ()
 Removes all entries from dictionary. More...
 
bool enter (size_t key, void *value)
 Enters a key,value pair into the dictionary. More...
 
bool enter (const void *key, void *value)
 Convenience variant with pointer type as key: More...
 
bool find (size_t key, void *&value) const
 Finds entry with given key, setting value to point to value. More...
 
bool find (const void *key, void *&value) const
 Convenience variant with pointer type as key: More...
 
void makePList (SbPList &keys, SbPList &values)
 Makes two SbPLists, one for keys and the other for values. More...
 
bool remove (size_t key)
 Removes the entry with the given key. Returns FALSE if no such entry. More...
 
bool remove (const void *key)
 Convenience variant with pointer type as key: More...
 

Detailed Description

Definition at line 101 of file SbDict.h.

Constructor & Destructor Documentation

◆ SbDict()

SbDict::SbDict ( int  entries = 251)

◆ ~SbDict()

SbDict::~SbDict ( )

Member Function Documentation

◆ applyToAll() [1/2]

void SbDict::applyToAll ( void(*)(size_t key, void *value)  rtn)

The order of entries is not guaranteed to mean anything.

◆ applyToAll() [2/2]

void SbDict::applyToAll ( void(*)(size_t key, void *value, void *data)  rtn,
void *  data 
)

The order of entries is not guaranteed to mean anything.

◆ clear()

void SbDict::clear ( )

◆ enter() [1/2]

bool SbDict::enter ( const void *  key,
void *  value 
)
inline

Definition at line 126 of file SbDict.h.

References enter().

Referenced by enter().

◆ enter() [2/2]

bool SbDict::enter ( size_t  key,
void *  value 
)

Overwrites entry and returns FALSE if key already exists.

◆ find() [1/2]

bool SbDict::find ( const void *  key,
void *&  value 
) const
inline

Definition at line 132 of file SbDict.h.

References find().

Referenced by find().

◆ find() [2/2]

bool SbDict::find ( size_t  key,
void *&  value 
) const

Returns FALSE if no such entry.

◆ makePList()

void SbDict::makePList ( SbPList keys,
SbPList values 
)

The order of entries is not guaranteed to mean anything.

◆ remove() [1/2]

bool SbDict::remove ( const void *  key)
inline

Definition at line 141 of file SbDict.h.

References remove().

Referenced by remove().

◆ remove() [2/2]

bool SbDict::remove ( size_t  key)

The documentation for this class was generated from the following file: