チケット #48792

is_<enum>_user_flag()

登録: 2023-10-03 03:16 最終更新: 2024-05-29 18:36

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
1

詳細

Follow-up idea to #48790 : when specenum has user flags defined, specenum generator could output inline function "bool is_<enum>_user_flag(enum <enum>)"

This would also at least reduce the need for defining likes of TER_USER_LAST.

チケットの履歴 (5 件中 3 件表示)

2023-10-03 03:16 更新者: cazfi
  • 新しいチケット "is_<enum>_user_flag()" が作成されました
2023-10-05 22:48 更新者: alienvalkyrie
コメント

Seems reasonable. Short-term, adding new things now does mean that the code gets split between <file>_enums_gen.h and specenum_gen.h, but long-term, we'll want to phase out the latter anyway.

I'm not sure about the name, given that codegen-side, I called them "generic"; so I'd probably make it bool is_<enum>_generic(enum <enum>). Then again, we are only using them for user flags, so it could instead be reasonable to use that language codegen-side.

Depending on the use cases, we might want to have a bunch more general #defines; e.g. for the last generic value (like EF_LAST_USER_FLAG or TER_USER_LAST) or the total number of generic values (like MAX_NUM_USER_EXTRA/TER_FLAGS).

2024-05-27 21:20 更新者: alienvalkyrie
  • 担当者(未割り当て) から alienvalkyrie に更新されました
  • 解決法なし から 受領 に更新されました
コメント

Made it so the name for the function is chosen on a per-enum basis (just like the names for the generic enum members are). So it can be is_foo_user_flag or is_user_foo_flag or is_foo_flag_user_flag or whatever would be appropriately in line with other code involving that specific enum.

2024-05-29 18:36 更新者: alienvalkyrie
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする