C4DThread Class Reference

abstract

#include <c4d_thread.h>

Inheritance diagram for C4DThread:
Inheritance graph
[ legend ]

详细描述

User thread object. Deprecated 。使用 maxon::ThreadInterface /JobInterface etc.

公共成员函数

  C4DThread ()
virtual  ~C4DThread (void)
BaseThread Get (void) const
Bool   开始 ( 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 Char GetThreadName (void)=0

Private Attributes

Bool   weak
BaseThread bt

Friends

class  MPThreadPool

构造函数 & 析构函数文档编制

◆  C4DThread()

C4DThread ( )

Constructor. Deprecated .

◆  ~C4DThread()

virtual ~ C4DThread ( void  )
virtual

Destructor. Deprecated .

成员函数文档编制

◆  Get()

BaseThread * Get ( void  ) const

Retrieves the BaseThread for the thread. Deprecated .

返回
The BaseThread of the thread. The thread owns the pointed base thread.

◆  Start()

Bool 开始 ( THREADMODE   mode = THREADMODE::ASYNC ,
THREADPRIORITYEX   priority = THREADPRIORITYEX::NORMAL  
)

Starts the thread running. Deprecated 。使用 maxon::ThreadInterface::Start() .

参数
[in] mode The thread mode: THREADMODE
[in] priority The thread priority: THREADPRIORITYEX
返回
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 。使用 maxon::ThreadInterface::Wait() or GetResult().

警告
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.
参数
[in] wait Determines if thread termination is synchronous or asynchronous:
  • true the function will not return until the thread is finished.
  • 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 。使用 maxon::ThreadInterface::Wait() .

返回
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 。使用 maxon::ThreadInterface::IsCancelled() .

注意
Check for break conditions, such as if ESC has been pressed outside of the thread.
返回
true processing should be terminated, otherwise false .

◆  Wait()

void Wait ( Bool   checkevents = false )

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

参数
[in] checkevents 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 。使用 maxon::ThreadInterface::IsCancelled() .

返回
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 。使用 maxon::ThreadInterface .

返回
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