SMACC
SMACC copied to clipboard
Implement smart pointers and signals2 tracking
This is an experimental branch to solve some of the issues we've been facing, described in #57 and #86
Basically, I've added the ability to gain access to clients from CBs as std::weak_ptr
s rather than raw pointers. Since they were saved as std::shared_ptr
s already within the state machine, it was a pretty straight-forward change.
The main change is using boost::signals2
tracking facility to automatically monitor and control a slot's lifetime based on when the owning CB goes out of scope. Early tests show that this might prevents the issue we've been facing where member variables are being access from a CB callback after the callback has been deallocated upon state transitions.
Both these changes have been integrated in a small part within the sm_ferrari
example's CB if you wanted to see the intended usage
This is very much WIP and a lot needs to be refined. Opening up this PR for visibility and comments