SimpleKernel 1.17.0
Loading...
Searching...
No Matches
StateRunning Struct Reference

Running 状态 — 任务正在执行 More...

#include <task_fsm.hpp>

Inheritance diagram for StateRunning:
Inheritance graph
Collaboration diagram for StateRunning:
Collaboration graph

Public Member Functions

auto on_event (const MsgYield &) -> etl::fsm_state_id_t
 
auto on_event (const MsgSleep &) -> etl::fsm_state_id_t
 
auto on_event (const MsgBlock &) -> etl::fsm_state_id_t
 
auto on_event (const MsgExit &msg) -> etl::fsm_state_id_t
 
auto on_event_unknown (const etl::imessage &msg) -> etl::fsm_state_id_t
 

Detailed Description

Running 状态 — 任务正在执行

Definition at line 65 of file task_fsm.hpp.

Member Function Documentation

◆ on_event() [1/4]

auto StateRunning::on_event ( const MsgBlock ) -> etl::fsm_state_id_t
inline

Definition at line 74 of file task_fsm.hpp.

74 {
76 }
constexpr etl::fsm_state_id_t kBlocked
Definition task_fsm.hpp:18

◆ on_event() [2/4]

auto StateRunning::on_event ( const MsgExit msg) -> etl::fsm_state_id_t
inline

Definition at line 77 of file task_fsm.hpp.

77 {
78 if (msg.has_parent) {
80 }
82 }
constexpr etl::fsm_state_id_t kExited
Definition task_fsm.hpp:19
constexpr etl::fsm_state_id_t kZombie
Definition task_fsm.hpp:20
bool has_parent
是否有父任务

◆ on_event() [3/4]

auto StateRunning::on_event ( const MsgSleep ) -> etl::fsm_state_id_t
inline

Definition at line 71 of file task_fsm.hpp.

71 {
73 }
constexpr etl::fsm_state_id_t kSleeping
Definition task_fsm.hpp:17

◆ on_event() [4/4]

auto StateRunning::on_event ( const MsgYield ) -> etl::fsm_state_id_t
inline

Definition at line 68 of file task_fsm.hpp.

68 {
70 }
constexpr etl::fsm_state_id_t kReady
Definition task_fsm.hpp:15

◆ on_event_unknown()

auto StateRunning::on_event_unknown ( const etl::imessage &  msg) -> etl::fsm_state_id_t
inline

Definition at line 83 of file task_fsm.hpp.

83 {
84 klog::Warn("TaskFsm: Running received unexpected message id={}",
85 static_cast<int>(msg.get_message_id()));
86 return STATE_ID;
87 }
auto Warn(etl::format_string< Args... > fmt, Args &&... args) -> void
以 WARN 级别记录日志
Here is the call graph for this function:

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