0

我有以下 boost::statechart 状态:

struct PendingWFInfo : bsc::state<PendingWFInfo, PseudoIdle> {
  bool success;
  PendingWFInfo(my_context ctx) : my_base(ctx) {
    std::cout << "[+] PendingWFInfo" << std::endl;
    success = context<RH_StateMachine>().startReplenishment();
    if (success) {
      std::cout
          << ".....................Start replenishment successfully called\n";
    } else {
      std::cout << ".....................Failed to call Start replenishment "
                   "service\n";
    }
  }
  ~PendingWFInfo() { std::cout << "[-] leaving PendingWFInfo state... \n"; }
  typedef boost::mpl::list<bsc::custom_reaction<InboundInfoReceived>,
                           bsc::transition<Error, CommunicationError>
                           > reactions;
  bsc::result react(const InboundInfoReceived &event) {
    if (context<RH_StateMachine>().getWireframeCapacity() > 0) {
      transit<UserConfirmationPending>();
    }
    else{
      transit<InboundImpossible>();
    }
  }
};

当我处于当前状态并发出 InboundInfoReceived 事件时,我收到以下错误 /usr/include/boost/statechart/result.hpp:58: boost::statechart::detail::safe_reaction_result::~safe_reaction_result() : 断言“reactionResult_ == 消耗”失败。

if 语句为真,但转换给了我一个断言错误。

4

0 回答 0