SoCallbackList(3)

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

πŸ’– SoCallbackList β€” okay bestie, let's talk callback containers πŸ’–

So this is SoCallbackList(3), from the Library Functions Manual, and ngl it's one of those little utility queens that just does its job and does it flawlessly. ✨


🌸 NAME 🌸

SoCallbackList β€” the way that this is literally just a container for callback function pointers. That's it. That's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

First things first, you gotta invite it to the party:

#include <Inventor/lists/SoCallbackList.h>

πŸ‘‘ Public Member Functions πŸ‘‘

SoCallbackList (void)
~SoCallbackList ()
void addCallback (SoCallbackListCB *f, void *userData=NULL)
void removeCallback (SoCallbackListCB *f, void *userdata=NULL)
void clearCallbacks (void)
int getNumCallbacks (void) const
void invokeCallbacks (void *callbackdata)

✨ Detailed Description ✨

Okay so <pink>SoCallbackList</pink> is a container for callback function pointers. Periodt. πŸ’…

Here's the tea: this list stores callback function pointers β€” and also the user-specified extra data you want passed to those callbacks β€” and then it hands you a method for triggering the callback functions. So it's like a little group chat of functions, and you get to decide when the whole chat goes off. 🫢


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

πŸ’œ SoCallbackList::SoCallbackList (void )

Default constructor. It makes a baby callback list. That's it, she's born. 🐣

πŸ’œ SoCallbackList::~SoCallbackList (void )

Destructor. She's leaving, she said goodbye, she's cleaning up. 😭


🌈 Member Function Documentation 🌈

⭐ void SoCallbackList::addCallback (SoCallbackListCB * f, void * userdata = NULL)

Append the callback function f to the list. πŸ“₯ And when it gets invoked, it will be passed the userdata. So userdata is like the little snack you pack for your callback before it goes out β€” highkey important.

⭐ void SoCallbackList::removeCallback (SoCallbackListCB * f, void * userdata = NULL)

Remove callback f from the list. Bye bestie, we love you, the door's right there. πŸ‘‹

⭐ void SoCallbackList::clearCallbacks (void )

Remove all callbacks in the list. Not me nuking the entire group chat in one move. πŸ’€

⭐ int SoCallbackList::getNumCallbacks (void ) const

Returns number of callback functions. A headcount, fr fr. πŸ”’

⭐ void SoCallbackList::invokeCallbacks (void * callbackdata)

Invoke all callback functions, passing the userdata and the callbackdata as the first and second argument, respectively. πŸ”₯

Heads up, this part matters: all callbacks registered when the method is invoked will be triggered β€” even if the code in one callback removes another callback. So the list is locked in for this round, no take-backs. 🧚

And it is safe for a callback to remove itself or any other callbacks during execution. So yes, a callback can absolutely cancel itself mid-sentence. Main character energy, honestly. πŸ‘‘


πŸ’– Author πŸ’–

Generated automatically by Doxygen for Coin from the source code.


And that's the whole page, bestie! 🌟 This was SoCallbackList(3) from Coin, Version 3.1.3 β€” slay, go forth and invoke responsibly. πŸ’…βœ¨πŸŒΈπŸ¦‹πŸŽ€πŸ’œ

πŸ“¦ where this page comes from