SoCallbackList(3)

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

πŸ’– SoCallbackList(3) πŸ’–

okay bestie, gather round, because today we're talking about SoCallbackList from the Library Functions Manual β€” yes, that SoCallbackList(3), the one and only. it's a container for callback function pointers, and honestly? it's giving ✨personal assistant for your function pointers✨.


🌸 NAME 🌸

SoCallbackList β€” a container for callback function pointers. that's it, that's the whole job, and she does it flawlessly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#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)

look at that lineup. iconic. no notes. πŸ‘‘


πŸ¦‹ Detailed Description πŸ¦‹

so SoCallbackList is a container for callback function pointers. periodt.

here's the tea: this list stores callback function pointers β€” and like, along with the user-specified extra data you wanna pass to those callbacks β€” and then it gives you a method for triggering the callback functions. it's a whole group chat where you can @everyone on demand. πŸ”₯


πŸ’œ Constructor & Destructor Documentation πŸ’œ

🌈 SoCallbackList::SoCallbackList (void )

Default constructor. she's born. welcome to the world, little list πŸŽ€

🌈 SoCallbackList::~SoCallbackList (void )

Destructor. she's leaving. say bye 🫢


πŸ‘‘ 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 gets handed the userdata. so like, f shows up to the party and userdata is their plus-one. bestie behavior. πŸ’–

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

Remove callback f from the list. bye girl, we love you, hope you thrive elsewhere πŸ’…

ngl she's not doing this alone β€” she references getNumCallbacks(), and SoDebugError::post().

⭐ void SoCallbackList::clearCallbacks (void )

Remove all callbacks in the list. like, everyone. the whole group chat, gone. no survivors. πŸ’€ (affectionately)

⭐ int SoCallbackList::getNumCallbacks (void ) const

Returns number of callback functions. the headcount. the census. the "how many of us are in here" check πŸ“‹

she's referenced by removeCallback() β€” so like, removeCallback() is lowkey stalking her. iykyk.

⭐ void SoCallbackList::invokeCallbacks (void * callbackdata)

Invoke all callback functions, passing the userdata and the callbackdata as the first and second argument, respectively. so first arg = userdata, second arg = callbackdata. in that order. no cap. πŸ—£οΈ

and here's the important part, so listen up: all callbacks registered when the method is invoked will be triggered β€” even though if the code in one callback removes another callback. yeah. the call list is locked in at the moment of invocation. once you're on the guest list, you're getting in, even if somebody shreds the guest list mid-party. πŸŽ‰

It is safe for a callback to remove itself or any other callbacks during execution. so go ahead, self-destruct, remove your friends, it's fine, the code won't yell at you. that's genuinely so considerate of her fr fr πŸ₯Ή

she references SbPList::getLength(). shoutout to the underclassman doing the actual counting. 🌟

πŸ’– Author πŸ’–

Generated automatically by Doxygen for Coin from the source code. yeah, a robot wrote this, and it ate. πŸ€–βœ¨


okay that's the whole page bestie, go forth and register your callbacks responsibly πŸ’…πŸŒΈ

signing off β€” this was Coin, Version 2.5.0, on the SoCallbackList(3) page, and yes the manpage name is literally in the footer too, we're consistent like that πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from