SoMemoryError(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– SoMemoryError(3) β€” the Coin manual, bestie edition πŸ’–

okay so this is the manual page for SoMemoryError, and it lives in the Coin manual (section 3, the library-call girlies). it's all about memory allocation problems and honestly? it's giving "the one friend who tells you when something's wrong." 🫢


✨ NAME ✨

SoMemoryError β€” the SoMemoryError class is used to inform of problems with memory allocation. like, it's literally the messenger. don't shoot her. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/errors/SoMemoryError.h>

Inherits SoError.

🌸 Public Member Functions 🌸

  • virtual SoType getTypeId (void) const

πŸ’œ Public Member Functions inherited from SoError πŸ’œ

  • virtual ~SoError ()
  • const SbString & getDebugString (void) const
  • SbBool isOfType (const SoType type) const

πŸŽ€ Static Public Member Functions πŸŽ€

  • static void setHandlerCallback (SoErrorCB *const callback, void *const data)
  • static SoErrorCB * getHandlerCallback (void)
  • static void * getHandlerData (void)
  • static SoType getClassTypeId (void)
  • static void post (const char *const whatWasAllocated)
  • static void initClass (void)

πŸ’œ Static Public Member Functions inherited from SoError πŸ’œ

  • static void setHandlerCallback (SoErrorCB *const func, void *const data)
  • static SoErrorCB * getHandlerCallback (void)
  • static void * getHandlerData (void)
  • static SoType getClassTypeId (void)
  • static void post (const char *const format,...)
  • static SbString getString (const SoNode *const node)
  • static SbString getString (const SoPath *const path)
  • static SbString getString (const SoEngine *const engine)
  • static void initClass (void)
  • static void initClasses (void)

πŸ¦‹ Protected Member Functions πŸ¦‹

  • virtual SoErrorCBPtr getHandler (void *&data) const

πŸ’œ Protected Member Functions inherited from SoError πŸ’œ

  • void setDebugString (const char *const str)
  • void appendToDebugString (const char *const str)
  • void handleError (void)

🌈 Additional Inherited Members 🌈

πŸ’œ Static Protected Member Functions inherited from SoError πŸ’œ

  • static void defaultHandlerCB (const SoError *error, void *userdata)

🌟 Detailed Description 🌟

The SoMemoryError class is used to inform of problems with memory allocation. that's the whole job description, and she does it flawlessly. πŸ‘‘

okay so modern operating systems takes care of handling most out of memory conditions for you, but in certain situations it can be wise to do some manual checking and intervention. this class is provided as an aid to help out in these situations. think of it as your emotional support error class. πŸ˜­πŸ’–

the basic design of the Coin library is to pass on the responsibility for handling failed attempts at memory allocation to the application programmer. so if you want to detect and take care of these, you should compile Coin with the C++ exception throwing on and wrap your code within try{} and catch{} blocks. the most you can do if you get a failed allocation is typically to notify the user and then exit the application, though, and this is something most operating systems will do for you, so you probably need not consider this at all. lowkey the OS has it covered, no cap.

so, where does the SoMemoryError class come in handy? there are certain things which could happen within the library which are best taken care of by internally handling failed attempts at memory allocation. an example: the user tries to load a model file which contains a filename pointer to a huge bitmap file with a texture map. the end-user's system does not provide enough memory to load the file and prepare the texture image for rendering, though. this is a case where it is possible to just emit a warning and continue. the warning will then be passed through this class. so graceful. so slay. ✨

note that SoMemoryError is probably not of much use to the application programmer. bestie, she said "this isn't for you" and she meant it. πŸ™ˆ

πŸ’… Member Function Documentation πŸ’…

πŸ“ void SoMemoryError::setHandlerCallback (SoErrorCB *const function, void *const data) [static]

this method sets the error handler callback for messages posted via this class. it's the "hey, when something goes wrong, call THIS person" energy. πŸ“ž

note that this will not override the error/debug message handler for subclasses, these will have to be overridden by calling the subclass' setHandlerCallback() method. so don't be out here thinking one call fixes everything for the whole family tree. πŸ’€

See also

  • defaultHandlerCB()

πŸ“ SoErrorCB * SoMemoryError::getHandlerCallback (void ) [static]

returns the error handler callback for messages posted via this class. the "who did you say to call again?" method. 🫢

πŸ“ void * SoMemoryError::getHandlerData (void ) [static]

this method returns the pointer used for passing data back to the callback handler method. it's the little bag of snacks you hand to the callback so she has everything she needs. πŸŽ€

πŸ“ SoType SoMemoryError::getClassTypeId (void ) [static]

this static method returns the SoType for this class.

See also

  • getTypeId()

πŸ“ SoType SoMemoryError::getTypeId (void ) const [virtual]

this method returns the SoType of a particular object instance. not the class, the instance, okay? main character energy, individual edition. πŸ‘‘

See also

  • getClassTypeId()

Reimplemented from SoError.

πŸ“ void SoMemoryError::post (const char *const whatWasAllocated) [static]

posts a warning about a failed memory allocation. whatWasAllocated should contain a description of what we tried to allocate. like, tell the people what you were trying to do. be specific, be honest. πŸ—£οΈ

πŸ“ void SoMemoryError::initClass (void ) [static]

this method takes care of initializing all static data for the class. she's setting up the whole vibe before the party starts. πŸŽ‰

πŸ“ SoErrorCB * SoMemoryError::getHandler (void *& data) const [protected], [virtual]

this is just a convenience wrapper around the getHandlerCallback() and getHandlerData() methods. two methods, one cute little shortcut. obsessed. πŸ’–

Reimplemented from SoError.


🌸 Author 🌸

generated automatically by Doxygen for Coin from the source code. not me being a whole auto-generated queen. ✨


and that's the whole page, bestie!! this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and yes she's SoMemoryError(3) through and through. stay allocated, stay iconic. πŸ’…πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from