SOBASELIST(3iv)

πŸ’– SoBaseList β€” like, the whole vibe

okay bestie, welcome to the manual page for SoBaseList(3IV) β€” that's the section-3 page, 3IV being the Open Inventor flavour, iykyk. Sit down, grab a boba, we're doing pointer lists today and honestly? It's giving organized.


✨ NAME ✨

SoBaseList β€” she maintains a list of pointers to instances of the SoBase classes. That's it, that's the job, and she does it flawlessly. πŸ’…


🌸 INHERITS FROM 🌸

SbPList > SoBaseList

so like, SbPList is the parent and SoBaseList is the main character daughter who inherited everything and then some. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <Inventor/SoLists.h>

Methods from class SoBaseList:

                     SoBaseList()
                     SoBaseList(int size)
                     SoBaseList(const SoBaseList &l)
                     ~SoBaseList()
 void                append(SoBase *ptr)
 void                insert(SoBase *ptr, int addBefore)
 void                remove(int which)
 void                truncate(int start)
 void                copy(const SoBaseList &l)
 SoBaseList &        operator =(const SoBaseList &l)
 SoBase *            operator [](int i) const
 void                set(int i, SoBase *ptr)
 void                addReferences(SbBool flag)

Methods from class SbPList (the inherited ones, the nepo babies, love them):

 int                 find(const void *ptr) const
 int                 getLength() const
 int                 operator ==(const SbPList &pl) const
 int                 operator !=(const SbPList &pl) const

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: this subclass of SbPList holds lists of pointers to instances of classes derived from SoBase β€” and SoBase is an abstract class, so you're never holding a raw SoBase, you're holding its gorgeous descendants. 🌈

Now the important part, no cap: there's a flag that says whether adding an instance pointer to the list should also add a reference to the instance. If that flag is TRUE, then adding and removing pointers from the list updates reference counts in the corresponding instances. So the list is basically keeping receipts for you β€” every add and remove gets reflected in the ref counts. 🧾✨

if you're not careful with that flag, you and your reference counts are gonna have a whole situationship. Just saying. πŸ’€

πŸ’œ METHODS πŸ’œ

SoBaseList()

Constructor. She's born. πŸŽ€

SoBaseList(int size)

Constructor that pre-allocates storage for size pointers. Future-proofing, we love a planner. πŸ“‹

SoBaseList(const SoBaseList &l)

Constructor that copies the contents of another list. Twin behaviour, but make it legal. πŸ‘―

~SoBaseList()

Destructor. She said bye. 🫢


  • void append(SoBase *ptr) β€” Adds a pointer to the end of the list. Line up, bestie, you're last. πŸšΆβ™€οΈ
  • void insert(SoBase *ptr, int addBefore) β€” Inserts the given pointer in the list before the pointer with the given index. Cutting the line, but politely and with permission. πŸ™ˆ
  • void remove(int which) β€” Removes the pointer with the given index. Gone, blocked, deleted. πŸ’€
  • void truncate(int start) β€” Removes all pointers after the one with the given index, inclusive. So yeah, the one at start gets yeeted too. Not a drill. 😭
  • void copy(const SoBaseList &l) β€” Copies a list, keeping all reference counts correct. The responsible copy. ✨
  • SoBaseList & operator =(const SoBaseList &l) β€” Copies a list, keeping all reference counts correct. Same energy, assignment-flavoured. πŸ’–
  • SoBase * operator [](int i) const β€” Accesses an element of a list. Yes queen, indexing. πŸ”₯
  • void set(int i, SoBase *ptr) β€” Sets an element of a list. Swap in, swap out. πŸ”
  • void addReferences(SbBool flag) β€” Indicates whether to call ref() and unref() for bases in the list when adding/removing them. The default value is TRUE. Remember the default, bestie, it matters. ⭐

🌈 SEE ALSO 🌈

  • SoBase
  • SoNodeList
  • SoPathList

go read those next, they're all connected, it's a whole cinematic universe. 🎬


okay and for the little sign-off: the page footer just says SoBaseList(3IV)() β€” no version number, no date, absolutely nothing in those lil parentheses. Mysterious. Minimalist. Iconic. ✨ We stan a page that refuses to overshare. πŸ’–πŸ¦‹πŸŽ€