SOCALLBACKLIST(3iv)

πŸ’– SoCallbackList β€” no cap, it's the callback list queen πŸ’–

okay bestie, welcome to the SoCallbackList(3IV) page β€” yes that's the manual name, we're fancy like that πŸŽ€

🌸 NAME 🌸

SoCallbackList β€” manages a list of callback functions and associated data ✨

🧬 INHERITS FROM 🧬

SoCallbackList

like, it inherits from itself, which is very main character of it πŸ’…

✨ SYNOPSIS ✨

#include <Inventor/misc/SoCallbackList.h>

typedef void        SoCallbackListCB(void *userData, void *callbackData)

Methods from class SoCallbackList:

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So this class is literally the group chat admin of callback functions πŸ“‹ β€” it manages a whole list of callback functions and user data together.

Here's the vibe: you (the user) can add a callback function to the list, and you bring your own userData along with it. Then when that callback gets invoked, it gets handed your userData β€” plus some callback data that the invoking routine itself specified. And the type of that callback data? Not SoCallbackList's problem, bestie β€” that's determined by the invoking routine. iykyk 🫢


πŸ’… METHODS πŸ’…

  • SoCallbackList()
  • ~SoCallbackList()

Constructor and destructor. Birth and farewell, iconic behavior 🌈

  • void addCallback(SoCallbackListCB *f, void *userData = NULL)
  • void removeCallback(SoCallbackListCB *f, void *userData = NULL)

Adds a function to β€” or removes a function from β€” the list of callback functions. In and out, no drama, periodt ✨

  • void clearCallbacks()

Clears all callback functions from the list. Everything. Gone. Poof πŸ’€

  • int getNumCallbacks() const

Returns the number of callback functions in the list. A little headcount, a little roll call πŸŽ€

  • void invokeCallbacks(void *callbackData)

Invokes each callback function in the list, passing each function the userData supplied when they were registered here, and callbackData, the callback-specific data supplied by the caller. Everybody gets called, everybody gets their data, it's giving democracy πŸ”₯


ngl bestie, if you add a callback and forget to remove it, that's on you β€” the list does not forget πŸ™ˆ

and that's the whole page, bestie!! πŸ’– written up in the SoCallbackList(3IV)() manual, source SoCallbackList(3IV)() β€” same title, no date drama, we keep it timeless ⭐ mwah, go slay your callbacks πŸ‘‘