Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Friends | List of all members
SysThreadTaskManager Class Reference
Inheritance diagram for SysThreadTaskManager:
CoreBaseObject CoreBaseType

Public Member Functions

 SysThreadTaskManager (SysThreadManager *thread_manager=nullptr)
 
SysThreadManagerget_thread_manager () const
 
void set_thread_manager (SysThreadManager *thread_manager)
 
void abort ()
 
bool is_aborted () const
 
unsigned int get_thread_count () const
 
unsigned int get_max_thread_count () const
 
void add_task (SysThreadTask &task, const bool &auto_delete=true, const bool &is_preemptible=true)
 
bool has_pending_tasks () const
 
bool yield ()
 
void wait_until_completed ()
 
void shutdown ()
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
virtual size_t get_memory_size () const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Friends

class SysThreadManager
 
class SysThreadWorker
 
class SysThreadData
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 

Detailed Description

Manager for SysThreadTasks.

Member Function Documentation

void SysThreadTaskManager::abort ( )
inline

Abort the task manager. Running tasks will continue until completed, and unstarted ones will be removed.

void SysThreadTaskManager::add_task ( SysThreadTask task,
const bool &  auto_delete = true,
const bool &  is_preemptible = true 
)

Add a task to be processed by the task manager

Parameters
taskthe task to be added.
auto_deletetrue if the task can be deleted automatically by the task manager, false if not.
is_preemptibletrue if the task can be interrupted, false otherwise.
bool SysThreadTaskManager::has_pending_tasks ( ) const
inline

Query if there are remaining pending tasks.

Returns
true if pending task count is > 0, false otherwise.
bool SysThreadTaskManager::is_aborted ( ) const
inline

Query if the task manager is aborted.

Returns
true if aborted, false otherwise.
void SysThreadTaskManager::shutdown ( )

Abort the task manager, destroy unstarted pending tasks and wait for running tasks to complete.

void SysThreadTaskManager::wait_until_completed ( )

Wait for all tasks to be completed (blocks the current thread).

If the task manager is interrupted during the wait, tasks that have not started yet are aborted.

bool SysThreadTaskManager::yield ( )

Process one task and wait for it.

Returns
true if a task was processed, false otherwise.