Rhino C++ API  8.6
Classes | Public Member Functions | List of all members
CRhinoGetCancel Class Reference

#include <rhinoSdkGet.h>

Classes

class  Task
 

Public Member Functions

 CRhinoGetCancel ()
 
 CRhinoGetCancel (const CRhinoGetCancel &)=delete
 
virtual ~CRhinoGetCancel ()
 
void DoNotWaitForTasksToFinishWhenCancelled (void)
 
int MaxConcurrentTasks () const
 
CRhinoGetCanceloperator= (const CRhinoGetCancel &)=delete
 
bool Run (const wchar_t *prompt, const std::vector< std::shared_ptr< Task >> &tasks, const CRhinoDoc *pDoc) const
 
void SetAllowCancelWhileAnotherApplicationHasFocus (bool b)
 
void SetMaxConcurrentTasks (int)
 

Detailed Description

Description: Used to perform background calculations on different threads while waiting for completion or the user to press escape to cancel.

Constructor & Destructor Documentation

◆ CRhinoGetCancel() [1/2]

CRhinoGetCancel::CRhinoGetCancel ( )

◆ CRhinoGetCancel() [2/2]

CRhinoGetCancel::CRhinoGetCancel ( const CRhinoGetCancel )
delete

◆ ~CRhinoGetCancel()

virtual CRhinoGetCancel::~CRhinoGetCancel ( )
virtual

Member Function Documentation

◆ DoNotWaitForTasksToFinishWhenCancelled()

void CRhinoGetCancel::DoNotWaitForTasksToFinishWhenCancelled ( void  )

Description: When escape is pressed the ON_Terminator passed to all tasks is set to to a state where termination has been requested. The Run function will wait until all of the tasks have finished unless this function is called.

◆ MaxConcurrentTasks()

int CRhinoGetCancel::MaxConcurrentTasks ( ) const

Description: Max number of concurrent tasks to run. By default, this is the number of processors - 2.

◆ operator=()

CRhinoGetCancel& CRhinoGetCancel::operator= ( const CRhinoGetCancel )
delete

◆ Run()

bool CRhinoGetCancel::Run ( const wchar_t *  prompt,
const std::vector< std::shared_ptr< Task >> &  tasks,
const CRhinoDoc pDoc 
) const

Description: Runs a number of asynchronous tasks and waits for either all of the tasks to complete or for the user to cancel by pressing escape Parameters: prompt - [in] prompt to display at the command prompt tasks - [in] the tasks to run doc - [in] document this run is associated with Returns: true if all tasks ran to completion false if the tasks were cancelled

◆ SetAllowCancelWhileAnotherApplicationHasFocus()

void CRhinoGetCancel::SetAllowCancelWhileAnotherApplicationHasFocus ( bool  b)

Description: Sets whether escape cancels the task while another application has focus.

◆ SetMaxConcurrentTasks()

void CRhinoGetCancel::SetMaxConcurrentTasks ( int  )

Description: Set the max number of concurrent tasks to run.