CGraph
Classes | Public Member Functions | Private Attributes | List of all members
UTask Class Reference

基于内嵌类TaskBased和TaskDerided,将传入的func完美转发成TaskDerided的func_成员; TaskDerided是UTask的impl_成员,运行UTask实际上就是调用impl_->run也就是调用func_() More...

#include <UTask.h>

Inheritance diagram for UTask:
Inheritance graph
[legend]
Collaboration diagram for UTask:
Collaboration graph
[legend]

Classes

struct  TaskBased
 
struct  TaskDerided
 

Public Member Functions

template<typename F >
 UTask (F &&func, int priority=0)
 
CVoid operator() ()
 
 UTask ()=default
 
 UTask (UTask &&task) noexcept
 
UTaskoperator= (UTask &&task) noexcept
 
CBool operator> (const UTask &task) const
 
CBool operator< (const UTask &task) const
 
- Public Member Functions inherited from CStruct
virtual ~CStruct ()=default
 

Private Attributes

std::unique_ptr< TaskBasedimpl_ = nullptr
 
CInt priority_ = 0
 

Detailed Description

基于内嵌类TaskBased和TaskDerided,将传入的func完美转发成TaskDerided的func_成员; TaskDerided是UTask的impl_成员,运行UTask实际上就是调用impl_->run也就是调用func_()

Constructor & Destructor Documentation

◆ UTask() [1/3]

template<typename F >
UTask::UTask ( F &&  func,
int  priority = 0 
)
inline

◆ UTask() [2/3]

UTask::UTask ( )
default

◆ UTask() [3/3]

UTask::UTask ( UTask &&  task)
inlinenoexcept

Member Function Documentation

◆ operator()()

CVoid UTask::operator() ( )
inline

◆ operator<()

CBool UTask::operator< ( const UTask task) const
inline

◆ operator=()

UTask& UTask::operator= ( UTask &&  task)
inlinenoexcept

◆ operator>()

CBool UTask::operator> ( const UTask task) const
inline

Member Data Documentation

◆ impl_

std::unique_ptr<TaskBased> UTask::impl_ = nullptr
private

◆ priority_

CInt UTask::priority_ = 0
private

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