示例#1
0
 bool operator()(EVT const& evt,FSM&,SourceState& ,TargetState& )
 {
     if (evt.get_attribute(cd_type)!=DISK_CD)
     {
         return false;
     }
     return true;
 }
 bool operator()(EVT const& evt,FSM&,SourceState& ,TargetState& )
 {
     // to test a guard condition, let's say we understand only CDs, not DVD
     if (evt.get_attribute(cd_type)!=DISK_CD)
     {
         std::cout << "wrong disk, sorry" << std::endl;
         // just for logging, does not block any transition
         return true;
     }
     std::cout << "good disk" << std::endl;
     return true;
 }