GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
boot_mode_selector.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_BOOT_MODE_SELECTOR_H_
9#define DESIGNLAB_BOOT_MODE_SELECTOR_H_
10
11#include <type_traits>
12
13#include "boot_mode.h"
14
15
16namespace designlab
17{
18
22{
23public:
25
28 constexpr void SetDefaultBootMode(const BootMode default_mode)
29 {
30 default_mode_ = default_mode;
31 };
32
39
40private:
41 const int kBootModeNum;
42
43 BootMode default_mode_;
44
45
46 // BootMode が int 型に変換可能か確かめる.
47 static_assert(
48 std::is_same<std::underlying_type<BootMode>::type, int>::value,
49 "'BootMode' must be able to convert to int type.");
50};
51
52} // namespace designlab
53
54
55#endif // DESIGNLAB_BOOT_MODE_SELECTOR_H_
起動モードを選択するクラス.
constexpr void SetDefaultBootMode(const BootMode default_mode)
デフォルトの起動モードを設定する.
BootMode SelectBootMode()
起動モードを選択する. BootModeが int 型をもとにしているかつ, 0から始まることを前提にしているので, うまく動作しない場合は,BootModeの定義を見直すこと.
BootMode
起動モードを表す列挙型.
Definition boot_mode.h:19