SimpleKernel 1.17.0
Loading...
Searching...
No Matches
TaskFsm Class Reference

任务有限状态机 More...

#include <task_fsm.hpp>

Collaboration diagram for TaskFsm:
Collaboration graph

Public Member Functions

auto Start () -> void
 启动 FSM(在 TCB 完全构造后调用)
 
auto Receive (const etl::imessage &msg) -> void
 向 FSM 发送消息
 
auto GetStateId () const -> etl::fsm_state_id_t
 获取当前状态 ID
 
构造/析构函数
 TaskFsm ()
 
 TaskFsm (const TaskFsm &)=delete
 
 TaskFsm (TaskFsm &&)=delete
 
auto operator= (const TaskFsm &) -> TaskFsm &=delete
 
auto operator= (TaskFsm &&) -> TaskFsm &=delete
 
 ~TaskFsm ()=default
 

Private Attributes

StateUnInit state_uninit_
 
StateReady state_ready_
 
StateRunning state_running_
 
StateSleeping state_sleeping_
 
StateBlocked state_blocked_
 
StateExited state_exited_
 
StateZombie state_zombie_
 
etl::ifsm_state * state_list_ [7]
 
etl::fsm fsm_
 

Detailed Description

任务有限状态机

Definition at line 152 of file task_fsm.hpp.

Constructor & Destructor Documentation

◆ TaskFsm() [1/3]

TaskFsm::TaskFsm ( )
inline

Definition at line 175 of file task_fsm.hpp.

183 fsm_.set_states(state_list_, 7);
184 }
etl::ifsm_state * state_list_[7]
Definition task_fsm.hpp:202
StateReady state_ready_
Definition task_fsm.hpp:195
StateZombie state_zombie_
Definition task_fsm.hpp:200
StateUnInit state_uninit_
Definition task_fsm.hpp:194
StateRunning state_running_
Definition task_fsm.hpp:196
etl::fsm fsm_
Definition task_fsm.hpp:204
StateExited state_exited_
Definition task_fsm.hpp:199
StateBlocked state_blocked_
Definition task_fsm.hpp:198
StateSleeping state_sleeping_
Definition task_fsm.hpp:197
constexpr etl::message_router_id_t kTaskFsm

◆ TaskFsm() [2/3]

TaskFsm::TaskFsm ( const TaskFsm )
delete

◆ TaskFsm() [3/3]

TaskFsm::TaskFsm ( TaskFsm &&  )
delete

◆ ~TaskFsm()

TaskFsm::~TaskFsm ( )
default

Member Function Documentation

◆ GetStateId()

auto TaskFsm::GetStateId ( ) const -> etl::fsm_state_id_t
inline

获取当前状态 ID

Returns
etl::fsm_state_id_t 当前状态 ID

Definition at line 169 of file task_fsm.hpp.

169 {
170 return fsm_.get_state_id();
171 }
Here is the caller graph for this function:

◆ operator=() [1/2]

auto TaskFsm::operator= ( const TaskFsm ) -> TaskFsm &=delete
delete

◆ operator=() [2/2]

auto TaskFsm::operator= ( TaskFsm &&  ) -> TaskFsm &=delete
delete

◆ Receive()

auto TaskFsm::Receive ( const etl::imessage &  msg) -> void
inline

向 FSM 发送消息

Parameters
msg要发送的消息

Definition at line 163 of file task_fsm.hpp.

163{ fsm_.receive(msg); }
Here is the caller graph for this function:

◆ Start()

auto TaskFsm::Start ( ) -> void
inline

启动 FSM(在 TCB 完全构造后调用)

Definition at line 157 of file task_fsm.hpp.

157{ fsm_.start(); }
Here is the caller graph for this function:

Member Data Documentation

◆ fsm_

etl::fsm TaskFsm::fsm_
private

Definition at line 204 of file task_fsm.hpp.

◆ state_blocked_

StateBlocked TaskFsm::state_blocked_
private

Definition at line 198 of file task_fsm.hpp.

◆ state_exited_

StateExited TaskFsm::state_exited_
private

Definition at line 199 of file task_fsm.hpp.

◆ state_list_

etl::ifsm_state* TaskFsm::state_list_[7]
private

Definition at line 202 of file task_fsm.hpp.

◆ state_ready_

StateReady TaskFsm::state_ready_
private

Definition at line 195 of file task_fsm.hpp.

◆ state_running_

StateRunning TaskFsm::state_running_
private

Definition at line 196 of file task_fsm.hpp.

◆ state_sleeping_

StateSleeping TaskFsm::state_sleeping_
private

Definition at line 197 of file task_fsm.hpp.

◆ state_uninit_

StateUnInit TaskFsm::state_uninit_
private

Definition at line 194 of file task_fsm.hpp.

◆ state_zombie_

StateZombie TaskFsm::state_zombie_
private

Definition at line 200 of file task_fsm.hpp.


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