C4DThread Class Referenceabstract

#include <c4d_thread.h>

Inheritance diagram for C4DThread:

Detailed Description

User thread object. Deprecated. Use maxon::ThreadInterface/JobInterface etc.

Public Member Functions

 C4DThread ()
 
virtual ~C4DThread (void)
 
BaseThreadGet (void) const
 
Bool Start (THREADMODE mode=THREADMODE::ASYNC, THREADPRIORITYEX priority=THREADPRIORITYEX::NORMAL)
 
void End (Bool wait=true)
 
Bool IsRunning (void)
 
Bool TestBreak (void)
 
void Wait (Bool checkevents=false)
 
virtual Bool TestDBreak (void)
 
virtual void Main (void)=0
 
virtual const CharGetThreadName (void)=0
 

Private Attributes

Bool weak
 
BaseThreadbt
 

Friends

class MPThreadPool
 

Constructor & Destructor Documentation

◆ C4DThread()

C4DThread ( )

Constructor. Deprecated.

◆ ~C4DThread()

virtual ~C4DThread ( void  )
virtual

Destructor. Deprecated.

Member Function Documentation

◆ Get()

BaseThread* Get ( void  ) const

Retrieves the BaseThread for the thread. Deprecated.

Returns
The BaseThread of the thread. The thread owns the pointed base thread.

◆ Start()

Starts the thread running. Deprecated. Use maxon::ThreadInterface::Start().

Parameters
[in]modeThe thread mode: THREADMODE
[in]priorityThe thread priority: THREADPRIORITYEX
Returns
true if the thread was started, otherwise false.

◆ End()

void End ( Bool  wait = true)

Ends the thread. This function will not return until the thread has completely stopped. Deprecated. Use maxon::ThreadInterface::Wait() or GetResult().

Warning
If the thread does not check for TestBreak() then this function will not return until the thread has finished and this might get into a deadlock situation.
Parameters
[in]waitDetermines if thread termination is synchronous or asynchronous:
  • If true the function will not return until the thread is finished.
  • If false the function returns immediately although the thread will still run until it is finished.

◆ IsRunning()

Bool IsRunning ( void  )

Checks if the thread is running. Deprecated. Use maxon::ThreadInterface::Wait().

Returns
true if the thread is running, otherwise false.

◆ TestBreak()

Bool TestBreak ( void  )

Checks if the thread received a break command to stop processing.
Normally this is only true when Cinema 4D is closing, or when End() has been called.
This function is used by the Semaphore class during the Semaphore::Lock() to check if the thread has been stopped. Deprecated. Use maxon::ThreadInterface::IsCancelled().

Note
Add more break conditions, such as if ESC has been pressed, in TestDBreak().
Returns
true processing should be terminated, otherwise false.

◆ Wait()

void Wait ( Bool  checkevents = false)

Waits until the thread has finished. Deprecated. Use maxon::ThreadInterface::Wait() or GetResult().

Parameters
[in]checkeventsIf false then wait until the thread has finished. If true then additionally return if a Cinema 4D event occurred.

◆ TestDBreak()

virtual Bool TestDBreak ( void  )
virtual

Override to add user breaks such as pressing the ESC key. This function is called by TestBreak(). Deprecated. Use maxon::ThreadInterface::IsCancelled().

Returns
true if processing should be terminated, otherwise false.

◆ Main()

virtual void Main ( void  )
pure virtual

Override with the thread main code. Deprecated. Use maxon::ThreadInterface::operator ()().

Implemented in ProgressThread.

◆ GetThreadName()

virtual const Char* GetThreadName ( void  )
pure virtual

Override to return the name of the thread. Deprecated. Use maxon::ThreadInterface.

Returns
The thread name. The thread owns the pointed character buffer.

Implemented in ProgressThread.

Friends And Related Function Documentation

◆ MPThreadPool

friend class MPThreadPool
friend

Member Data Documentation

◆ weak

Bool weak
private

◆ bt

BaseThread* bt
private