2011-03-01 4 views
0

asynchronous_state_machine의 processor_handle에서 스케줄러를 참조 할 수 있습니까?boost asynchronous_state_machine

코드 :

struct A { 
    A(sc::fifo_scheduler<>::processor_handle& h):player_ref(h){} 
    sc::fifo_scheduler<>::processor_handle& player_ref; 
    void a_func(){ 
     //I have to send event to player, but don't have scheduler 
     scheduler.queue_event(player_ref_, ...); //? 
    } 
}; 

sc::fifo_scheduler<> scheduler(true); 
sc::fifo_scheduler<>::processor_handle player = 
    scheduler1.create_processor<Player>(); 
A a(player); 

답변

1

아니, 현재. 의도적으로 processor_handle 개체가 있어도 프로세서가 호스팅되는 스케줄러가 있는지 보증하지 않습니다.

따라서 시나리오에서 A의 생성자에 스케줄러를 전달하고 데이터 멤버에 저장해야합니다 .

관련 문제