SoMemoryError(3)
π SoMemoryError π
okay bestie, welcome to SoMemoryError(3) β that's a section 3 library function from the Library Functions Manual, and she's all about memory allocation going sideways. π«Ά
β¨ NAME β¨
SoMemoryError β the class that exists to tell you when memory allocation is doing the absolute most and failing. π
πΈ SYNOPSIS πΈ
#include <Inventor/errors/SoMemoryError.h>
She Inherits SoError, so everything SoError can do, she can do too. Main character energy, fr fr. π
π Public Member Functions
virtual SoType getTypeId (void) const
π Public Member Functions inherited from SoError
virtual ~SoError ()const SbString & getDebugString (void) constSbBool 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, and she does it well. β¨
So here's the tea: modern operating systems take care of handling most out of memory conditions for you already β they're doing the work so you don't have to. But in certain situations it can be wise to do some manual checking and intervention, and this class is provided as an aid to help out in exactly those moments. π«Ά
The basic design of the Coin library is to pass on the responsibility for handling failed attempts at memory allocation to the application programmer. Like, that's on you, bestie. π 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 anyway, so you probably need not consider this at all. lowkey a relief tbh.
So, where does the SoMemoryError class come in handy? Great question, glad you asked. π 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 bitmapfile with a texture map. But the end-user's system does not provide enough memory to load the file and prepare the texture image for rendering. π This is a case where it is possible to just emit a warning and continue β and the warning will then be passed through this class. iconic behaviour, honestly.
Note that SoMemoryError is probably not of much use to the application programmer. π₯² Sorry babe, she's built for the library's internal drama.
π Member Function Documentation π
π SoType SoMemoryError::getTypeId (void ) const [virtual]
This method returns the SoType of a particular object instance. She knows who she is. π
See also
getClassTypeId()
Reimplemented from SoError.
π void SoMemoryError::post (const char *const whatWasAllocated) [static]
Posts a warning about a failed memory allocation. The whatWasAllocated argument should contain a description of what we tried to allocate. So like, tell her what flopped, and she'll announce it. π’
π SoErrorCB * SoMemoryError::getHandler (void *& data) const [protected], [virtual]
This is just a convenience wrapper around the getHandlerCallback() and getHandlerData() methods. Two steps, one lil shortcut. π
Reimplemented from SoError.
π Author π
Generated automatically by Doxygen for Coin from the source code. No human wrote this, bestie, a robot did. π€β¨
and that's the whole page, periodt. π this doc came to you from Coin, Version 3.1.3, and yeah β it's the SoMemoryError(3) page, so you know exactly where to find her again. mwah, go forth and allocate responsibly. π
ππ¦
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms