#include <toppers/task.hpp>
toppers::task_body< Diagnostics, Stub >に対する継承グラフ

Public メンバ関数 | |
| task_body (VP_INT exinf) | |
| 拡張情報を受取るコンストラクタ | |
|
const task< 0, Diagnostics, Stub > & | get_task () const |
| 自タスク管理オブジェクトの参照 | |
| void | run () |
| タスク本体動作の実行 | |
| VP_INT | get_extended_info () const |
| タスクの拡張情報の参照 | |
Static Public メンバ関数 | |
| void | exit () |
| タスクの終了 | |
| void | exit_and_destroy () |
| タスクの終了と削除 | |
| ER | sleep (forever_tag=forever) |
| タスクの起床待ち | |
| ER | sleep (TMO tmout) |
| タスクの起床待ち(タイムアウト指定) | |
| ER | delay (RELTIM dlytim) |
| タスクの遅延 | |
| ER | yield () |
| タスクの切り替え | |
Static Public 変数 | |
| const task_context_tag | task_context = toppers::task_context |
| タスクコンテキストを指定する定数 | |
| const non_task_context_tag | non_task_context = toppers::non_task_context |
| 非タスクコンテキストを指定する定数 | |
| const task_context_tag | context_independent = toppers::task_context |
| 現在のコンテキスト(すなわちタスクコンテキスト)を指定する定数 | |
Protected 型 | |
| typedef Stub | stub |
| サービスコールスタブ | |
Protected メンバ関数 | |
| ~task_body () | |
| デストラクタ | |
Static Protected メンバ関数 | |
| ID | get_task_id () |
| 実行中のタスクID番号を参照する | |
/* task_body.h */ #ifndef TASK_BODY_H #define TASK_BODY_H #define MAIN_PRIORITY 5 /* メインタスクの優先度 */ #define STACKSIZE 0x2000 typedef struct { int counter; } MY_TASK_DATA; #ifdef __cplusplus extern "C" { #endif extern MY_TASK_DATA my_task_data; void my_task(VP_INT); #ifdef __cplusplus } #endif #endif
// task_body.cpp #include <toppers/task.hpp> #include "task_body.h" MY_TASK_DATA my_task_data = { 0 }; class my_task_body : public toppers::task_body<> { public: explicit my_task_body(VP_INT exinf) : toppers::task_body<>(exinf) { } MY_TASK_DATA& get_data() { return *(MY_TASK_DATA*)get_extended_info(); } void run() { for (;;) { delay(10); ++get_data().counter; } } }; void my_task(VP_INT exinf) { toppers::task_entry<my_task_body>(exinf); }
/* task_body.cfg */ INCLUDE("\"task_body.h\""); CRE_TSK(MY_TASK, { TA_HLNG | TA_ACT, (VP_INT)&my_task_data, my_task, MID_PRIORITY, STACK_SIZE, NULL }); #include "./systask/cxxrt.cfg" #include "./systask/timer.cfg" #include "./systask/serial.cfg" #include "./systask/logtask.cfg"
|
|||||||||
|
自タスクを終了させる。 自動記憶域に生成されたインスタンスのデストラクタを確実に呼出すため、 直接ext_tsk を呼出すのではなく、例外をスローしている。
|
|
|||||||||
|
自タスクを終了させた後、削除する。 自動記憶域に生成されたインスタンスのデストラクタを確実に呼出すため、 直接exd_tsk を呼出すのではなく、例外をスローしている。
|