StateMachine is a class which can process state issue. It bases on boost::function and std::vector.