Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get access to state objects in log_state_change #581

Open
Icantjuddle opened this issue Jun 7, 2023 · 0 comments
Open

Cannot get access to state objects in log_state_change #581

Icantjuddle opened this issue Jun 7, 2023 · 0 comments

Comments

@Icantjuddle
Copy link

Expected Behavior

I've been keeping small amounts of state in my state machine's state types (i.e. time it was activated). I'd like to be able to access this data in the logger to print it out.

So far I have been unable to figure out how to do this. I've tried log_state_change and log_event for an on_entry event but haven't figured it out.

It seems this results from the type signature and that the actual state objects could be available.

sml/include/boost/sml.hpp

Lines 2491 to 2498 in 0387da0

template <class SM, class TDeps, class TSubs, class TSrcState, class TDstState>
constexpr void update_current_state(SM &, TDeps &deps, TSubs &, typename SM::state_t &current_state,
const typename SM::state_t &new_state, const TSrcState &, const TDstState &) {
back::policies::log_state_change<typename SM::sm_t>(aux::type<typename SM::logger_t>{}, deps,
aux::string<typename TSrcState::type>{},
aux::string<typename TDstState::type>{});
current_state = new_state;
}

Actual Behavior

No way to log state objects.

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

No branches or pull requests

1 participant