Re: [boost] Preliminary submission: Finite State Machine framework
Hi Andreas, [...] > An attempt at an easy-to-use FSM library that supports > well-maintainable and code-expressive machines of almost any size and > does not require a code generator can be found in the fsm directories > in the boost-sandbox and here: > > http://groups.yahoo.com/group/boost/files/FSM/ > > There is comprehensive tutorial and rationale documentation. All code > has been tested with MSVC7.1 and boost 1.30.0 > > Features include: > > - Straightforward transformation from UML state chart to executable > C++ code and vice versa > - Comprehensive UML semantics support: >- Hierarchical (composite, nested) states >- Orthogonal (concurrent) states >- Entry-, exit- and transition-actions >- Guards >- Event deferral > - Error handling support > - Full type-safety > - State-local storage > - Customizable resource management It's very exciting to see a FSM framework coming close to the formal submission stage! IMO state machines are something that every software engineer should be famililiar with, because no matter what kind of software you write, if there is any significant amount of logic in it, FSMs can offer you the means to structure and simplify it, improve its adaptability to changes, and ultimately make it more understandable, robust, and easier to maintain, debug, and verify. That is, if you have a tool at hand that makes implementing FSMs as easy and enjoyable as it should be. So, while here at work we have developed an in-house technology that achieves that goal for small-to-medium FSMs (the first prototype of which is outlined in the MPL paper), I am really looking forward to studying experts' work on the subject. Well, meanwhile, besides the above, my first comment is going to be really minor - I browsed over the tutorial (which looks great!), and although I am sure you know it, I thought it would be worth to point out that the 'public' specifier is redundant when the derived class is declared as 'struct'; if you omit those, the examples' syntax would become even more DSL-like (== better :). Aleksey ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: [BGL] Patch for nonrecursive DFS to fix stack overflow
Looks like my name didn't get added to my post. :( Bruce Barr ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: shared_ptr/weak_ptr and thread-safety
Alexander Terekhov wrote: > > Russell Hind wrote: > > > > Trevor Taylor wrote: > > > > > > Who? Me? > > > > > > > I think Peter meant Alexander > > I got the message. I'll post refcount typename integer_t> once I'll have some time for it. It won't include > atomic<> implementation(s), however. ;-) http://terekhov.de/pthread_refcount_t/experimental/refcount.cpp regards, alexander. -- http://groups.google.com/groups?selm=3EC4F194.2DA8701C%40web.de ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] start_vertex patch for depth_first_visit
It appears that depth_first_visit does not invoke the start_vertex visitors as the depth_first_search routines do. Here is a patch to correct that. Jeffrey *** depth_first_search.hpp.0Tue May 27 00:22:48 2003 --- depth_first_search.hpp Sat May 31 12:02:15 2003 *** *** 237,242 --- 237,243 typename graph_traits::vertex_descriptor u, DFSVisitor vis, ColorMap color) { + vis.start_vertex(u, g); detail::depth_first_visit_impl(g, u, vis, color); } ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Preliminary submission: Finite State Machine framework
Hi, Whenever I had to develop an FSM in the past, I chose either of the following paths: - For small and simple machines I often resorted to the IMHO ugly nested switch-case approach. - For bigger and more complex machines, I often used a code-generation approach because I failed to find a satisfactory library. No matter what solution I chose, I have always been missing code-expressiveness, ease-of-use and good maintainability. An attempt at an easy-to-use FSM library that supports well-maintainable and code-expressive machines of almost any size and does not require a code generator can be found in the fsm directories in the boost-sandbox and here: http://groups.yahoo.com/group/boost/files/FSM/ There is comprehensive tutorial and rationale documentation. All code has been tested with MSVC7.1 and boost 1.30.0 Features include: - Straightforward transformation from UML state chart to executable C++ code and vice versa - Comprehensive UML semantics support: - Hierarchical (composite, nested) states - Orthogonal (concurrent) states - Entry-, exit- and transition-actions - Guards - Event deferral - Error handling support - Full type-safety - State-local storage - Customizable resource management Any feedback is most welcome. Thanks, Andreas P.S. For people who are not yet using the boost library and would like to run the examples, FSM.zip contains a 4-step quick start guide. P.P.S. Developer summary ;-), copy-paste into your code editor: // The following code implements the state-machine: // // || // | O Active | // | ||< // | v| | EvReset // | | | // | || |- // | | Stopped| | // | | // | | ^ | // | | EvStartStop | EvStartStop |<-O // | v | | // | | // | || | // | | Running| | // | | // #include #include #include #include namespace fsm = boost::fsm; class EvStartStop : public fsm::event< EvStartStop > {}; class EvReset : public fsm::event< EvReset > {}; struct Active; struct StopWatch : public fsm::state_machine< StopWatch, Active > {}; struct Stopped; struct Active : public fsm::simple_state< Active, StopWatch, fsm::transition< EvReset, Active >, Stopped > {}; struct Running : public fsm::simple_state< Running, Active, fsm::transition< EvStartStop, Stopped > > {}; struct Stopped : public fsm::simple_state< Stopped, Active, fsm::transition< EvStartStop, Running > > {}; int main( int argc, char * argv[] ) { StopWatch myWatch; myWatch.initiate(); myWatch.process_event( EvStartStop() ); myWatch.process_event( EvStartStop() ); myWatch.process_event( EvStartStop() ); myWatch.process_event( EvReset() ); return 0; } ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost