Skip to content

Conversation

@Mchan2003
Copy link
Collaborator

@Mchan2003 Mchan2003 commented Sep 15, 2025

Fixes #33

Copy link
Collaborator

@PhazonicRidley PhazonicRidley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good! One small design question, is there a reason you are using raw pointers for your states? Do they need to stay alive after exiting? If so, is there a reason you are using raw pointers over smart pointers

@@ -0,0 +1,52 @@
#pragma once
#include <print>
#include "./state.hpp"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: include/ should be in the include path (this functionally doesn't matter but imo its cleaner without relative paths, also if we ever change our file structure then it doesn't need to be updated)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give me an example of what the include should look like

* SAFE will be stored here and shared between the states.
*
*/
class StateContext {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add doxygen style documentation (our good friend chaudexityilot is great at this)


class State;

class StateMachine {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs


class StateMachine {
public:
StateMachine();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: No need to declare a default ctor or dtor

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ctor is initializing the current_state to the first state. I also get an error if I don't declare the dtor as default

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.

State Machine boilerplate

3 participants