SBPLIST(3iv)

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

okay bestie, we're in the SbPList(3IV) manual page and it's giving pointer wrangler energy, so let's get into it 🫢


✨ NAME ✨

SbPList β€” a list of generic void * pointers. that's it. that's the whole vibe. a little roster of mystery pointers, living their best lives.


🌸 INHERITS FROM 🌸

SbPList

no cap, it just inherits from itself. iconic behavior honestly. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

first things first, you gotta pull it in:

#include <Inventor/SbPList.h>

and here's the whole method roster, exactly as written, no edits, no notes:

Methods from class SbPList:

                     SbPList()
                     SbPList(const SbPList &pl)
                     SbPList(int initSize)
                     ~SbPList()
void                append(void * ptr)
int                 find(const void *ptr) const
void                insert(void *ptr, int addBefore)
void                remove(int which)
int                 getLength() const
void                truncate(int start)
void                copy(const SbPList &pl)
SbPList &           operator =(const SbPList &pl)
void *&             operator [](int i) const
int                 operator ==(const SbPList &pl) const
int                 operator !=(const SbPList &pl) const

πŸŽ€ DESCRIPTION πŸŽ€

so like, this class manages a dynamic list of generic void * pointers. and the way that it lets you do random access, insertion, and removal?? obsessed. it's a whole flexible situation. 🌈


πŸ’œ METHODS πŸ’œ

the constructors + destructor era ✨

                     SbPList()
                     SbPList(const SbPList &pl)
                     SbPList(int initSize)
                     ~SbPList()

okay so these are your constructors and your destructor, the whole life cycle. 🍼

  • initSize sets an initial size for the list, and ngl that's genuinely useful as an optimization if you can estimate how long the list is gonna be before you even construct it. foresight queen. πŸ‘‘
  • and if you hand it another SbPList, it gives you back a copy of that list. twin. matching. 🫢

the rest of the squad 🧚

  • void append(void * ptr) β€” adds the given pointer to the end of the list. go to the back of the line bestie, respectfully. πŸšΆβ€β™€οΈ
  • int find(const void *ptr) const β€” hunts down the given pointer and returns its index in the list. and if it's not there? returns -1. she's not ghosting you, she's just not in this list. 😭
  • void insert(void *ptr, int addBefore) β€” inserts the given pointer into the list before the pointer with the given index. cutting the line, but make it legal. πŸ’…
  • void remove(int which) β€” removes the pointer with the given index. bye bye, we hardly knew ye. πŸ‘‹
  • int getLength() const β€” returns the number of pointers in the list. the headcount. the census. πŸ“‹
  • void truncate(int start) β€” removes all pointers after the one with the given index, inclusive. so like, that pointer at start? gone too. everything after it? also gone. it's a chop, not a trim. βœ‚οΈ
  • void copy(const SbPList &pl) β€” copies a list. straightforward, no drama, we love a simple queen. πŸ’–
  • SbPList & operator =(const SbPList &pl) β€” the assignment operator; it copies the list into this list. you are what you absorb or whatever. ✨
  • void *& operator [](int i) const β€” returns the pointer with the given index. random access unlocked, bestie. πŸ”“
  • int operator ==(const SbPList &pl) const
  • int operator !=(const SbPList &pl) const

β€” the equality and inequality operators. are they the same? are they not?? find out. πŸ’€


🌟 pro tip from your girl: truncate(int start) is inclusive, meaning the pointer at start gets removed too. read it twice, screenshot it, tattoo it. iykyk. πŸŽ€

and that's the whole page bestie!! this was SbPList(3IV) from the SbPList(3IV)() manual, section 3IV, source/version SbPList(3IV)() β€” literally all of it, slay. go forth and manage your void * pointers responsibly. πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€πŸ«ΆπŸ‘‘πŸŒˆβ­πŸ’œ