.TH "SoMemoryError" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoMemoryError \- .PP The \fBSoMemoryError\fP class is used to inform of problems with memory allocation\&. .PP 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\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoError\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void \fBsetHandlerCallback\fP (SoErrorCB *const callback, void *const data)" .br .ti -1c .RI "static SoErrorCB * \fBgetHandlerCallback\fP (void)" .br .ti -1c .RI "static void * \fBgetHandlerData\fP (void)" .br .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBpost\fP (const char *const whatWasAllocated)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual SoErrorCBPtr \fBgetHandler\fP (void *&data) const " .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoMemoryError\fP class is used to inform of problems with memory allocation\&. .PP 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\&. The basic design of the Coin library is to pass on the responsibility for handling failed attempts at memory allocation to the application programmer\&. 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 \fCtry{}\fP and \fCcatch{}\fP 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\&. .PP So, where does the \fBSoMemoryError\fP 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 bitmapfile 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\&. .PP Note that \fBSoMemoryError\fP is probably not of much use to the application programmer\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoMemoryError::getTypeId (void) const\fC [virtual]\fP" This method returns the \fBSoType\fP of a particular object instance\&. .PP \fBSee also:\fP .RS 4 getClassTypeId() .RE .PP .PP Reimplemented from \fBSoError\fP\&. .SS "void SoMemoryError::post (const char *constwhatWasAllocated)\fC [static]\fP" Posts a warning about a failed memory allocation\&. \fIwhatWasAllocated\fP should contain a description of what we tried to allocate\&. .SS "SoErrorCB * SoMemoryError::getHandler (void *&data) const\fC [protected]\fP, \fC [virtual]\fP" This is just a convenience wrapper around the getHandlerCallback() and getHandlerData() methods\&. .PP Reimplemented from \fBSoError\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.