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
15namespace designlab {
16
19class BootModeSelector final {
20 public:
22
25 constexpr void SetDefaultBootMode(const BootMode default_mode) {
26 default_mode_ = default_mode;
27 };
28
35
36 private:
37 const int kBootModeNum;
38
39 BootMode default_mode_;
40
41 // BootMode が int 型に変換可能か確かめる.
42 static_assert(std::is_same<std::underlying_type<BootMode>::type, int>::value,
43 "'BootMode' must be able to convert to int type.");
44};
45
46} // namespace designlab
47
48#endif // DESIGNLAB_BOOT_MODE_SELECTOR_H_
起動モードを選択するクラス.
constexpr void SetDefaultBootMode(const BootMode default_mode)
デフォルトの起動モードを設定する.
BootMode SelectBootMode()
起動モードを選択する. BootModeが int 型をもとにしているかつ, 0から始まることを前提にしているので, うまく動作しない場合は,BootModeの定義を見直すこと.
BootMode
起動モードを表す列挙型.
Definition boot_mode.h:16