Skip to content

Remove SMLFSM Macros and use functor classes instead of lambdas - #3920

Open
GrayHoang wants to merge 27 commits into
masterfrom
grayson/fsm_debug_window
Open

GrayHoang wants to merge 27 commits into
masterfrom
grayson/fsm_debug_window

Conversation

@GrayHoang

Copy link
Copy Markdown
Contributor

Description

There is a set of macros defined in sml_fsm.h that are supposed to make using Boost::SML a bit easier for members. While it does simplify the context, it obfuscates a lot of what's going on under the hood, and makes debugging and logging more difficult.

This PR removes all of those macros and replaces them with what they actually represent, in the case of State and Event macros.
It also defines a series of template classes to wrap action and guard functions into functor classes while preserving their context, to make logging and debugging easier (see #3489 for the potential applications of this).

This is a direct improvement over the macro I defined in #3489.

Testing Done

Compiles, thunderscope runs.

Resolved Issues

Length Justification and Key Files to Review

Most of the changes are just replacing the macro with an object initialization.
Please look at software/util/sml_fsm/sml_fsm.h.

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

williamckha and others added 27 commits July 11, 2026 22:54
…into william/bazel9

# Conflicts:
#	src/toolchains/cc/BUILD
 into william/bazel9

# Conflicts:
#	src/MODULE.bazel
Base automatically changed from avah/bazel9_pyqt6_fixes to master September 11, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants