FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxThread Class Reference

#include <fbxthread.h>

Class Description

This class implement a standard way to use threads across platforms.

Definition at line 29 of file fbxthread.h.

Public Types

enum  EState { eUnknown, eRunning, eDead }
 
enum  EPriority {
  eNone, eIdle, eLowest, eLow,
  eNormal, eHigh, eHighest, eRealTime
}
 

Public Member Functions

 FbxThread (FbxThreadProc pProc, void *pArg, bool pSuspend=false)
 Constructor. More...
 
 FbxThread (FbxThreadProc pProc, void *pArg, EPriority pPriority, bool pSuspend=false)
 Constructor. More...
 
virtual ~FbxThread ()
 Destructor. More...
 
bool Suspend ()
 Suspend the execution of the thread. More...
 
bool Resume ()
 Resume the execution of the thread. More...
 
bool Join ()
 Wait for the thread completion. More...
 
bool Kill ()
 Do not wait for the thread completion and terminate it. More...
 
EPriority GetPriority ()
 Retrieve the priority of the thread. More...
 
bool SetPriority (EPriority pPriority)
 Set the thread priority. More...
 
EState GetState ()
 Retrieve the thread current state. More...
 

Member Enumeration Documentation

◆ EState

enum EState
Enumerator
eUnknown 
eRunning 
eDead 

Definition at line 32 of file fbxthread.h.

◆ EPriority

enum EPriority
Enumerator
eNone 
eIdle 
eLowest 
eLow 
eNormal 
eHigh 
eHighest 
eRealTime 

Definition at line 33 of file fbxthread.h.

Constructor & Destructor Documentation

◆ FbxThread() [1/2]

FbxThread ( FbxThreadProc  pProc,
void *  pArg,
bool  pSuspend = false 
)

Constructor.

Parameters
pProcThe procedure called upon thread startup.
pArgThe arguments passed to the procedure.
pSuspendStart the thread suspended.

◆ FbxThread() [2/2]

FbxThread ( FbxThreadProc  pProc,
void *  pArg,
EPriority  pPriority,
bool  pSuspend = false 
)

Constructor.

Parameters
pProcThe procedure called upon thread startup.
pArgThe arguments passed to the procedure.
pPriorityThe thread priority to set upon creation.
pSuspendStart the thread suspended.

◆ ~FbxThread()

virtual ~FbxThread ( )
virtual

Destructor.

Member Function Documentation

◆ Suspend()

bool Suspend ( )

Suspend the execution of the thread.

Returns
Return true if the thread was successfully suspended, otherwise false.
Remarks
It should be used only if you can control where the thread will be suspended in its procedure, otherwise the state of the thread and its memory is unknown, since the code will stop anywhere.

◆ Resume()

bool Resume ( )

Resume the execution of the thread.

Returns
Return true if the thread was successfully resumed, otherwise false.

◆ Join()

bool Join ( )

Wait for the thread completion.

Returns
True if the thread successfully returned from its procedure.

◆ Kill()

bool Kill ( )

Do not wait for the thread completion and terminate it.

Returns
True if the thread successfully died.

◆ GetPriority()

EPriority GetPriority ( )

Retrieve the priority of the thread.

Returns
The thread's priority.

◆ SetPriority()

bool SetPriority ( EPriority  pPriority)

Set the thread priority.

Parameters
pPriorityThe priority to set to this thread.
Returns
True if the thread priority was successfully changed.

◆ GetState()

EState GetState ( )

Retrieve the thread current state.

Returns
The state of the thread.

The documentation for this class was generated from the following file: