StateOS
Loading...
Searching...
No Matches
stateos::TaskT< size_ > Struct Template Reference

create and initialize complete work area for task object More...

#include <ostask.h>

Inheritance diagram for stateos::TaskT< size_ >:

Public Types

using Deleter = struct _Deleter { void operator()( void* ) const {} }
 deleter of Ptr (does not delete the task object)
using Ptr = std::unique_ptr<TaskT<size_>, Deleter>
 result type of Create()

Public Member Functions

template<class F>
 TaskT (const unsigned _prio, F &&_proc)
 constructor, see the constructor parameters of the class
template<class F>
 TaskT (F &&_proc)
 constructor, see the constructor parameters of the class
template<typename F, typename... A>
 TaskT (const unsigned _prio, F &&_proc, A &&... _args)
 constructor, see the constructor parameters of the class
template<typename F, typename... A, typename = std::enable_if_t<std::is_invocable_v<F, A...>>>
 TaskT (F &&_proc, A &&... _args)
 constructor, see the constructor parameters of the class
 TaskT (TaskT< size_ > &&_src)
 move constructor
 TaskT (const TaskT< size_ > &)=delete
TaskT< size_ > & operator= (TaskT< size_ > &&)=delete
TaskT< size_ > & operator= (const TaskT< size_ > &)=delete

Static Public Member Functions

template<class F>
static TaskT< size_ > Make (const unsigned _prio, F &&_proc)
 create and initialize static undetachable task
template<class F>
static TaskT< size_ > Make (F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A>
static TaskT< size_ > Make (const unsigned _prio, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A, typename = std::enable_if_t<std::is_invocable_v<F, A...>>>
static TaskT< size_ > Make (F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class F>
static TaskT< size_ > Start (const unsigned _prio, F &&_proc)
 create, initialize and start static undetachable task
template<class F>
static TaskT< size_ > Start (F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A>
static TaskT< size_ > Start (const unsigned _prio, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A, typename = std::enable_if_t<std::is_invocable_v<F, A...>>>
static TaskT< size_ > Start (F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class F>
static Ptr Create (const unsigned _prio, F &&_proc)
 create, initialize and start dynamic joinable task
template<class F>
static Ptr Create (F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A>
static Ptr Create (const unsigned _prio, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A, typename = std::enable_if_t<std::is_invocable_v<F, A...>>>
static Ptr Create (F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class F>
static Ptr Detached (const unsigned _prio, F &&_proc)
 create, initialize and start dynamic detached task
template<class F>
static Ptr Detached (F &&_proc)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A>
static Ptr Detached (const unsigned _prio, F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename F, typename... A, typename = std::enable_if_t<std::is_invocable_v<F, A...>>>
static Ptr Detached (F &&_proc, A &&... _args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Detailed Description

template<size_t size_>
struct stateos::TaskT< size_ >

create and initialize complete work area for task object

Constructor parameters
  • size: size of task private stack (in bytes)
  • prio: initial task priority (any unsigned int value)
  • proc: task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop

Member Function Documentation

◆ Make()

template<size_t size_>
template<class F>
TaskT< size_ > stateos::TaskT< size_ >::Make ( const unsigned _prio,
F && _proc )
inlinestatic

create and initialize static undetachable task

Parameters
  • size: size of task private stack (in bytes)
  • prio: initial task priority (any unsigned int value)
  • proc: task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop
  • args: arguments for task proc
Returns
TaskT<> object

◆ Start()

template<size_t size_>
template<class F>
TaskT< size_ > stateos::TaskT< size_ >::Start ( const unsigned _prio,
F && _proc )
inlinestatic

create, initialize and start static undetachable task

Parameters
  • size: size of task private stack (in bytes)
  • prio: initial task priority (any unsigned int value)
  • proc: task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop
  • args: arguments for task proc
Returns
TaskT<> object

◆ Create()

template<size_t size_>
template<class F>
Ptr stateos::TaskT< size_ >::Create ( const unsigned _prio,
F && _proc )
inlinestatic

create, initialize and start dynamic joinable task

     with manageable resources
Parameters
  • size: size of task private stack (in bytes)
  • prio: initial task priority (any unsigned int value)
  • proc: task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop
  • args: arguments for task proc
Returns
std::unique_pointer / pointer to dynamic joinable TaskT<> object
Note
use only in thread mode

◆ Detached()

template<size_t size_>
template<class F>
Ptr stateos::TaskT< size_ >::Detached ( const unsigned _prio,
F && _proc )
inlinestatic

create, initialize and start dynamic detached task

     with manageable resources
Parameters
  • size: size of task private stack (in bytes)
  • prio: initial task priority (any unsigned int value)
  • proc: task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop
  • args: arguments for task proc
Returns
std::unique_pointer / pointer to dynamic detached TaskT<> object
Note
use only in thread mode

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