I have covered state_machine object with wrapper object to hide asynchronous_state_machine initialization.
class MyObject : public sc::asynchronous_state_machine< MyObject, MyObjectStateIdle, Scheduler, Allocator >;
MyObjectShell(constructor data){
Scheduler scheduler( true );
mProcessor = scheduler.create_processor< MyObject >(constructor data);
scheduler.initiate_processor( mProcessor );
mThread = std::move(Thread(boost::bind(
&sc::fifo_scheduler<>::operator(), &scheduler1, 0 )));
}
const MyObject* GetMyObject() const { /* What to place here to return MyObject, That I created via "scheduler.create_processor< MyObject >" */ }
const MyObject_state_enum GetState() const { /* What to place here to return MyObject's state*/ }
MyObject is my async_state_machine
But I still need to have an access to MyObject from outside of stateMachine. How can I get it from mProcessor or any other? Or I have to talk with state_machine only through scheduler.queue_event( mProcessor , parameters_); ?