3ds Max C++ API Reference
IBailOutBusyProcessManager Class Referenceabstract

An interface of bailing out the busy processing functions by pressing the 'Esc' key. More...

#include <BailOut.h>

+ Inheritance diagram for IBailOutBusyProcessManager:

Public Member Functions

virtual ~IBailOutBusyProcessManager ()
 Plug-ins may have functions of long busy process which can't be accepted by users. More...
 
virtual void EmbedBailOut ()=0
 At the beginning of the busy process, a bail-out can be embed, so that you can trigger the bail-out in the busy process to jump out the busy process. More...
 
virtual void BailOutEnd ()=0
 After bail-out operation is done, you need to end the bail-out. More...
 
virtual bool ShouldBail ()=0
 To detect whether the bail-out should jump out the busy process or not. More...
 
virtual bool IsBailOut () const =0
 To detect whether the bail-out is done or not. More...
 
virtual bool IsBailOutEmbeded () const =0
 To detect whether the bail-out is embed or not. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

An interface of bailing out the busy processing functions by pressing the 'Esc' key.

Constructor & Destructor Documentation

◆ ~IBailOutBusyProcessManager()

virtual ~IBailOutBusyProcessManager ( )
inlinevirtual

Plug-ins may have functions of long busy process which can't be accepted by users.

In this condition, users can use this interface to escape the long busy process by pressing ESC key.

void LongBusyProcess()
{
...
if(pBailOutManager)
{
pBailOutManager->EmbedBailOut();
}
for(int i=0; i<100000; i++)
{
if(pBailOutManager && pBailOutManager->ShouldBail())
{
MemoryClear(); // here users need to clear the memory manually.
break;
}
...
Process()
...
}
if(pBailOutManager)
{
pBailOutManager->BailOutEnd();
}
}
An interface of bailing out the busy processing functions by pressing the 'Esc' key.
Definition: BailOut.h:21
virtual void BailOutEnd()=0
After bail-out operation is done, you need to end the bail-out.
virtual void EmbedBailOut()=0
At the beginning of the busy process, a bail-out can be embed, so that you can trigger the bail-out i...
virtual bool ShouldBail()=0
To detect whether the bail-out should jump out the busy process or not.
UtilExport IBailOutBusyProcessManager * GetBailOutManager()

Note that, for safety when the bailout manager is used inside multiple nested function calls, the state of the instance is set and cleared only by the outermost calls to EmbedbailOut and BailOutEnd. For instance, if EmbedBailOut and BailOutEnd were called in Process() above, the state flags representing embedded state and bail-out condition would be initialized and cleared by the call in LengBusyProcess(), while the calls in Process() would serve to track the number of nested levels. Destructor

61 {}

Member Function Documentation

◆ EmbedBailOut()

virtual void EmbedBailOut ( )
pure virtual

At the beginning of the busy process, a bail-out can be embed, so that you can trigger the bail-out in the busy process to jump out the busy process.

For example, you can embed bail-out at the front of long time loop.

◆ BailOutEnd()

virtual void BailOutEnd ( )
pure virtual

After bail-out operation is done, you need to end the bail-out.

◆ ShouldBail()

virtual bool ShouldBail ( )
pure virtual

To detect whether the bail-out should jump out the busy process or not.

Returns
If true bail-out should jump out the busy process. If false bail-out should not jump out the busy process.

◆ IsBailOut()

virtual bool IsBailOut ( ) const
pure virtual

To detect whether the bail-out is done or not.

Returns
If true bail-out is done. If false bail-out is missed.

◆ IsBailOutEmbeded()

virtual bool IsBailOutEmbeded ( ) const
pure virtual

To detect whether the bail-out is embed or not.

Returns
If true bail-out is embed. If false bail-out is not embed.