SbPList(3)

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

πŸ’– SbPList(3) πŸ’–

okay bestie, sit DOWN, because we're about to talk about SbPList β€” straight out of the Coin manual (section 3, library functions, the good stuff). it's a container class, it holds void pointers, and it is genuinely iconic. no cap. 🫢


✨ NAME ✨

SbPList β€” the SbPList class is a container class for void pointers. that's it. that's the whole vibe. a lil box of anonymous pointers. πŸ’…


🌸 SYNOPSIS 🌸

#include <Inventor/lists/SbPList.h>

Inherited by SbIntList, SbStringList, SbVec3fList, SoActionMethodList, SoAuditorList [private], SoBaseList, SoDetailList, SoEngineOutputList, SoFieldList, SoPickedPointList, and SoTypeList. like, the whole friend group. every one of them. πŸŽ€

πŸ’« Public Member Functions

SbPList (const int sizehint=DEFAULTSIZE)
SbPList (const SbPList &l)
~SbPList ()
void copy (const SbPList &l)
SbPList & operator= (const SbPList &l)
void fit (void)
void append (void *item)
int find (const void *item) const
void insert (void *item, const int insertbefore)
void removeItem (void *item)
void remove (const int index)
void removeFast (const int index)
int getLength (void) const
void truncate (const int length, const int fit=0)
void ** getArrayPtr (const int start=0) const
void *& operator[] (const int index) const
int operator== (const SbPList &l) const
int operator!= (const SbPList &l) const
void * get (const int index) const
void set (const int index, void *item)

🧚 Protected Member Functions

void expand (const int size)
int getArraySize (void) const

πŸ‘‘ Detailed Description πŸ‘‘

SbPList is a container class for void pointers. again. it said it twice. it meant it. ✨


πŸ“ Constructor & Destructor Documentation πŸ“

SbPList::SbPList (const int sizehint = DEFAULTSIZE)

okay so this constructor sets the internal allocated size for the list to sizehint. and listen β€” the list will still initially contain ZERO items. it's just reserving the space, bestie. all dressed up, nowhere to go. πŸ™ˆ

Default constructor. 🌈

SbPList::SbPList (const SbPList & l)

Copy constructor. it copies. it's giving duplicate. πŸ’–

SbPList::~SbPList ()

Destructor. say bye bye. πŸ¦‹


πŸ’œ Member Function Documentation πŸ’œ

void SbPList::copy (const SbPList & l)

make this list a copy of l. clone arc. πŸ’«

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

Assignment operator. no semicolon needed in my heart but yes in your code. ✨

void SbPList::fit (void )

fit the allocated array exactly around the length of the list, discarding the memory spent on unused pre-allocated array cells. so it's like cleaning out your camera roll but for memory. 🧹

ngl, you should normally not need or want to call this method β€” it's only here so you have the option to optimize memory usage in the unlikely event that you're throwing around huge SbList objects within your application. it's the emergency-only little black dress of methods. πŸ’…

void SbPList::append (void * item) [inline]

append item to the end of the list. and it automatically allocates more items internally if needed, so you don't gotta worry about it. self-sufficient queen. πŸ‘‘

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

return the index of the first occurrence of item in the list, or -1 if item is not present. it's giving "where is she" and sometimes the answer is -1 (she's not here). 😭

void SbPList::insert (void * item, const int insertbefore)

insert item at index insertbefore.

careful bestie β€” insertbefore should not be larger than the current number of items in the list. do not test it. 🚫

void SbPList::removeItem (void * item)

removes an item from the list. and if there are several items with the same value, it removes the item with the lowest index. first come, first deleted. periodt. πŸ’€

void SbPList::remove (const int index)

remove the item at index, moving all subsequent items downwards one place in the list. everybody shuffle up. 🌸

void SbPList::removeFast (const int index) [inline]

remove the item at index, moving the last item into its place and truncating the list. it's the speedrun version. no order preservation, all efficiency. πŸ”₯

int SbPList::getLength (void ) const [inline]

returns the number of items in the list. how many girlies are at the party. πŸŽ€

void SbPList::truncate (const int length, const int fit = 0) [inline]

shorten the list to contain length elements, removing items from index length and onwards. bye to everyone past the velvet rope.

if fit is non-zero, it will also shrink the internal size of the allocated array.

but heads up β€” that is much less efficient than not re-fitting the array size. so like, know the cost before you do it. πŸ’…

void ** SbPList::getArrayPtr (const int start = 0) const [inline]

returns a pointer to a non-modifiable array of the list's elements. start specifies an index into the array.

the caller is not responsible for freeing up the array, because it's just a pointer into the internal array used by the list. it's a window, not a gift. πŸͺŸβœ¨

void *& SbPList::operator[] (const int index) const [inline]

returns the element at index.

and the way that it will automatically expand the size of the internal array if index is outside the current bounds of the list?? the values of any additional pointers are then set to NULL. growth mindset fr fr. 🌱

int SbPList::operator== (const SbPList & l) const

Equality operator. returns TRUE if this list and l are identical, containing the exact same ordered set of elements. same order, same everything, twin flame behavior. πŸ’–

int SbPList::operator!= (const SbPList & l) const [inline]

Inequality operator. returns TRUE if this list and l are not equal. the "we are NOT the same" operator. πŸ’…

void * SbPList::get (const int index) const [inline]

returns the element at index. and does not expand array bounds if index is outside the list. chill, lowkey, no surprises. πŸ™ˆ

void SbPList::set (const int index, void * item) [inline]

index operator to set the element at index. and it also does not expand array bounds if index is outside the list. you get what you get. πŸŽ€

void SbPList::expand (const int size) [inline], [protected]

expand the list to contain size items. the new items added at the end have undefined value β€” so like, don't assume they're NULL, bestie, they're literally whatever. πŸ’€

int SbPList::getArraySize (void ) const [inline], [protected]

return the number of items there's allocated space for in the array.

See also: getLength() 🫢


🌈 Author 🌈

Generated automatically by Doxygen for Coin from the source code. yes, a robot wrote it. and it ate. πŸ€–βœ¨


πŸ’Œ one last thing πŸ’Œ

this was SbPList(3) from Coin, Version 4.0.10, dated Thu Jun 25 2026 00:00:00. take care of her, she's a whole container class. mwah. πŸ’‹πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from