//boost状态机快速理解例程,VS2005编译通过!
//参考网络上资料改写,主要目的为自己备忘用。欢迎技术交流、项目合作!
//为方便快速理解,非关键字均已修改为中文!希望能抛砖引玉!
#include "stdafx.h"
#include <Windows.h>
#include <boost/statechart/event.hpp>
#include <boost/statechart/state_machine.hpp>
#include <boost/statechart/simple_state.hpp>
#include <boost/statechart/transition.hpp>
#include <iostream>
using namespace boost::statechart;//namespace sc = boost::statechart;
class 初始状态;
class 状态A;
//事件/
class 事件A : public event<事件A>
{
public:
事件A(void)
{
std::cout << "#触发事件A" << std::endl << std::endl;
}
};
class 事件B : public event<事件B>
{
public:
事件B(void)
{
std::cout << "
//参考网络上资料改写,主要目的为自己备忘用。欢迎技术交流、项目合作!
//为方便快速理解,非关键字均已修改为中文!希望能抛砖引玉!
#include "stdafx.h"
#include <Windows.h>
#include <boost/statechart/event.hpp>
#include <boost/statechart/state_machine.hpp>
#include <boost/statechart/simple_state.hpp>
#include <boost/statechart/transition.hpp>
#include <iostream>
using namespace boost::statechart;//namespace sc = boost::statechart;
class 初始状态;
class 状态A;
//事件/
class 事件A : public event<事件A>
{
public:
事件A(void)
{
std::cout << "#触发事件A" << std::endl << std::endl;
}
};
class 事件B : public event<事件B>
{
public:
事件B(void)
{
std::cout << "