Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SbPList Class Reference

List of generic (void *) pointers. More...

#include <Inventor/SbPList.h>

+ Inheritance diagram for SbPList:

Public Member Functions

 SbPList ()
 Default constructor.
 
 SbPList (int initSize)
 Constructor.
 
 SbPList (const SbPList &pl)
 Constructor.
 
virtual ~SbPList ()
 Destructor.
 
void append (void *ptr)
 Adds given pointer to end of list.
 
int find (const void *ptr) const
 Returns index of given pointer in list, or -1 if not found.
 
void insert (void *ptr, int addBefore)
 Inserts given pointer in list before pointer with given index.
 
virtual void remove (int which)
 Removes pointer with given index.
 
int getLength () const
 Returns number of pointers in list.
 
virtual void truncate (int start)
 Removes all pointers after one with given index, inclusive.
 
void copy (const SbPList &pl)
 Copies a list.
 
SbPListoperator= (const SbPList &pl)
 Assignment operator: copies list into this list.
 
void *& operator[] (const int index) const
 Returns pointer with given index.
 
int operator== (const SbPList &pl) const
 Equality operator.
 
int operator!= (const SbPList &pl) const
 Inequality operator.
 
void swap (int index1, int index2)
 Swaps element having index1 with the one having index2.
 

Detailed Description

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.

SEE ALSO

SoListSensor

Definition at line 76 of file SbPList.h.

Constructor & Destructor Documentation

◆ SbPList() [1/3]

SbPList::SbPList ( )

Default constructor.

The list is initially empty.

◆ SbPList() [2/3]

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.

◆ SbPList() [3/3]

SbPList::SbPList ( const SbPList pl)

Constructor.

It returns a copy of the specified SbPList.

◆ ~SbPList()

virtual SbPList::~SbPList ( )
virtual

Destructor.

Member Function Documentation

◆ append()

void SbPList::append ( void *  ptr)
inline

Adds given pointer to end of list.

Definition at line 221 of file SbPList.h.

◆ copy()

void SbPList::copy ( const SbPList pl)

Copies a list.

◆ find()

int SbPList::find ( const void *  ptr) const

Returns index of given pointer in list, or -1 if not found.

◆ getLength()

int SbPList::getLength ( ) const
inline

Returns number of pointers in list.

Definition at line 125 of file SbPList.h.

◆ insert()

void SbPList::insert ( void *  ptr,
int  addBefore 
)

Inserts given pointer in list before pointer with given index.

◆ operator!=()

int SbPList::operator!= ( const SbPList pl) const

Inequality operator.

◆ operator=()

SbPList & SbPList::operator= ( const SbPList pl)

Assignment operator: copies list into this list.

◆ operator==()

int SbPList::operator== ( const SbPList pl) const

Equality operator.

◆ 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.

Definition at line 228 of file SbPList.h.

◆ remove()

virtual void SbPList::remove ( int  which)
virtual

Removes pointer with given index.

Reimplemented in SoBaseList, and SoSensorList.

◆ swap()

void SbPList::swap ( int  index1,
int  index2 
)

Swaps element having index1 with the one having index2.

◆ truncate()

void SbPList::truncate ( int  start)
inlinevirtual

Removes all pointers after one with given index, inclusive.

Reimplemented in SoBaseList, SoDetailList, SoPickedPointList, and SoSensorList.

Definition at line 215 of file SbPList.h.


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