SoDetailList(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

SoDetailList β€” the container class that holds pointers to SoDetail objects. That's the whole vibe, bestie. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/lists/SoDetailList.h>

Inherits SbPList. Yes she's a nepo baby πŸ‘‘ β€” but like, in the good way, she genuinely inherited a whole personality from her parent.

🫢 Public Member Functions 🫢

  • SoDetailList (void)
  • SoDetailList (const int sizehint)
  • SoDetailList (const SoDetailList &l)
  • ~SoDetailList ()
  • void append (SoDetail *detail)
  • void insert (SoDetail *detail, const int insertbefore)
  • void truncate (const int length, const int fit=0)
  • void copy (const SoDetailList &l)
  • SoDetailList & operator= (const SoDetailList &l)
  • SoDetail * operator[] (const int idx) const
  • void set (const int index, SoDetail *item)

🌸 Public Member Functions inherited from SbPList 🌸

  • 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 (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)

🧚 Additional Inherited Members 🧚

Protected Member Functions inherited from SbPList

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

πŸ’– Detailed Description πŸ’–

The SoDetailList class is a container for pointers to SoDetail objects. She's a list, she holds details, that's her whole main character arc. 🌈

Now listen, this part is IMPORTANT, no cap: this list class will delete the details when it's destructed/truncated, or when a detail in the list gets replaced by another detail. So the caller is responsible for allocating the details passed to the list β€” but should not deallocate them, because the list handles that. 🫑

Bestie, do not free those details yourself. That's double-free territory and it's giving undefined behaviour πŸ’€. You allocate, she deallocates. That's the deal.

See also

  • SbPList

πŸ”₯ Constructor & Destructor Documentation πŸ”₯

SoDetailList::SoDetailList (void ) [inline]

Default constructor. The classic. No notes. ✨

References SbPList::SbPList().

Referenced by copy(), and SoDetailList().

SoDetailList::SoDetailList (const int sizehint) [inline]

This constructor initializes the internal allocated size for the list to sizehint. Heads up though β€” the list will still initially contain zero items. So it's like, she's got the space, she's just not using it yet. Reserved-but-empty energy. πŸ“

See also

  • SbList::SbList(const int sizehint)

References SbPList::SbPList().

SoDetailList::SoDetailList (const SoDetailList & l)

Copy constructor. A little clone of the original, obsessed. πŸ’œ

References copy(), SbPList::getLength(), SbPList::SbPList(), and SoDetailList().

SoDetailList::~SoDetailList ()

Destructor. She's logging off. 😭

References truncate().


⭐ Member Function Documentation ⭐

void SoDetailList::truncate (const int length, const int fit = 0)

Overridden to delete truncated items. Not just drop the pointers β€” actually delete the things. πŸ—‘οΈβœ¨

References SbPList::fit(), SbPList::getLength(), and SbPList::truncate().

Referenced by copy(), and ~SoDetailList().

void SoDetailList::copy (const SoDetailList & l)

Overridden to copy items, not just pointers. Yes bestie, this is the deep-copy moment β€” we're duplicating the actual details, not just pointing at the same ones like a fake friend. πŸ‘‘

References copy(), SbPList::getLength(), SoDetailList(), and truncate().

Referenced by copy(), SoDetailList(), and SoPickedPoint::SoPickedPoint().

SoDetail * SoDetailList::operator[] (const int idx) const [inline]

Returns the element at idx. Simple. πŸŽ€

But WAIT β€” she will automatically expand the size of the internal array if idx is outside the current bounds of the list. And the values of any additional pointers are then set to NULL. So she grows on demand and the new slots are null until you fill them. Growth mindset fr fr 🌱

References SbPList::SbPList().

void SoDetailList::set (const int idx, SoDetail * detail)

Overridden to delete the old item. Out with the old, in with the new. πŸ’…

References SbPList::getLength(), and SbPList::operator[]().


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code. (She didn't write herself, she was born iconic. No cap.)


And that's the whole page, bestie β€” this one's from Coin, Version 2.5.0, shipped alongside SoDetailList(3). Slay, stay safe, and don't free what the list owns πŸ’–βœ¨

πŸ“¦ where this page comes from