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

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: