Finite State Machine library Introduction

来源:互联网 发布:编程笔记本电脑配置 编辑:程序博客网 时间:2024/06/09 23:18

Finite State Machine library is a multi-thread pool C++ lib focus on finite state machine.You can use this lib on the scenario where you should deal with many states, each state, you may receive some events, then base on the event you received, the state will change into another state.

 

The library has three main concepts, first, of course State, which means the current status.The second concept is Event, which means what happens.And the last concept is FSM, the FSM is composed by the States, Which has initial state,end state, and several middle states, every states should be registered at least one or more events.So whenever the FSM received an Event sended to it, it will check the current State whether this Event has been registered on current State, if so, it will deal with it, and after it, change the status into other State, if not, it will call the default headler.

 

the library is a multi-thread pool libary,which means you can create several FSMs which may deal with the same things or not, base on your tasks;

 

Still it has auxiliary method for your to debug the library, by the tracer sub-system,you can tracer the whole execution environment ,also it's easy to learn.and easy to switch on/off the tracer info just by add some number :)

 

You may find that the there are one example at the example directory, one example couldn't explain everything but the main point.

 

Hope you have a nice journey on the FSM lib, any problem,just debug it or send me the mail,sunnydogzhou@hotmail.com