List of generic (void *) pointers. More...
#include <Inventor/SbPList.h>
Public Member Functions | |
SbPList () | |
SbPList (int initSize) | |
SbPList (const SbPList &pl) | |
virtual | ~SbPList () |
void | append (void *ptr) |
int | find (const void *ptr) const |
void | insert (void *ptr, int addBefore) |
virtual void | remove (int which) |
int | getLength () const |
virtual void | truncate (int start) |
void | copy (const SbPList &pl) |
SbPList & | operator= (const SbPList &pl) |
void *& | operator[] (const int index) const |
int | operator== (const SbPList &pl) const |
int | operator!= (const SbPList &pl) const |
void | swap (int index1, int index2) |
List of generic (void *) pointers.
This class manages a dynamic list of generic void * pointers. This class allows random access, insertion, and removal of pointers. Changes in SbPList can be detected by attaching an SoListSensor to this list.
SbPList::SbPList | ( | ) |
Default constructor.
The list is initially empty.
SbPList::SbPList | ( | int | initSize | ) |
Constructor.
initSize specifies an initial size for the list, which is useful as an optimization if you can estimate the length of the list before you construct it.
virtual SbPList::~SbPList | ( | ) | [virtual] |
Destructor.
void SbPList::append | ( | void * | ptr | ) | [inline] |
Adds given pointer to end of list.
void SbPList::copy | ( | const SbPList & | pl | ) |
Copies a list.
Reimplemented in SoBaseList, SoDetailList, and SoSensorList.
int SbPList::find | ( | const void * | ptr | ) | const |
Returns index of given pointer in list, or -1 if not found.
int SbPList::getLength | ( | ) | const [inline] |
Returns number of pointers in list.
void SbPList::insert | ( | void * | ptr, | |
int | addBefore | |||
) |
Inserts given pointer in list before pointer with given index.
int SbPList::operator!= | ( | const SbPList & | pl | ) | const |
Inequality operator.
Assignment operator: copies list into this list.
Reimplemented in SoDialogWidgetList, SoBaseList, SoDetailList, SoEngineList, SoNodeList, SoPathList, SoSensorList, and SoVRMLInterpList.
int SbPList::operator== | ( | const SbPList & | pl | ) | const |
Equality operator.
void *& SbPList::operator[] | ( | const int | index | ) | const [inline] |
Returns pointer with given index.
If requested index does not exists, list is grown to return a valid pointer.
Reimplemented in SoDialogWidgetList, SbStringList, SoBaseList, SoDetailList, SoEngineList, SoEngineOutputList, SoFieldList, SoNodeList, SoPathList, SoPickedPointList, SoSensorList, SoTypeList, SoVRMLEXTERNPROTOFieldList, SoVRMLInterpList, SoVRMLInterpOutputList, and SoVRMLPROTOFieldList.
virtual void SbPList::remove | ( | int | which | ) | [virtual] |
Removes pointer with given index.
Reimplemented in SoBaseList, and SoSensorList.
void SbPList::swap | ( | int | index1, | |
int | index2 | |||
) |
Swaps element having index1 with the one having index2.
void SbPList::truncate | ( | int | start | ) | [inline, virtual] |
Removes all pointers after one with given index, inclusive.
Reimplemented in SoBaseList, SoDetailList, SoPickedPointList, and SoSensorList.