boost statechart visualisation
play

boost::statechart visualisation Antons Jelkins Meeting C++ 2019 . - PowerPoint PPT Presentation

boost::statechart visualisation Antons Jelkins Meeting C++ 2019 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jelkins boost::statechart visualisation Meeting


  1. boost::statechart visualisation Antons Jel̦kins Meeting C++ 2019 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 1 / 7

  2. antons.jelkins@bmw.de About me Hello! My name is Anton. I work at BMW. I do software which runs in cars. I mostly code in C++. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 2 / 7

  3. struct Active : sc::simple_state< Active, StopWatch, Stopped > { using reactions = mpl::list< }; sc::result react( const EvPlayMusic &ev); struct StopWatch : sc::state_machine< StopWatch, Active > {}; sc::deferral< EvTerminate > >; struct EvStartStop : sc::event< EvStartStop > {}; sc::custom_reaction< EvPlayMusic >, sc::transition< EvReset, Active >, https://www.boost.org/doc/libs/1_71_0/libs/statechart/doc/tutorial.html What is boost::statechart ? ‘The Boost Statechart library is a framework that allows you to quickly transform a UML statechart into executable C++ code.’ Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 3 / 7

  4. It is relatively hard to get an overview of boost::statechart s by just looking at C++ code: No explicit transition table. Notation is quite verbose. Implementation can span multiple �iles. Problem statement Let’s have a look at these common use cases: New feature. State machine must be modi�ied. Code review. Someone modi�ied a state machine. Bug analysis. State machine misbehave. Learning. You are new to the code base. These tasks require you to have an overview of the state machines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 4 / 7

  5. Problem statement Let’s have a look at these common use cases: New feature. State machine must be modi�ied. Code review. Someone modi�ied a state machine. Bug analysis. State machine misbehave. Learning. You are new to the code base. These tasks require you to have an overview of the state machines. It is relatively hard to get an overview of boost::statechart s by just looking at C++ code: No explicit transition table. Notation is quite verbose. Implementation can span multiple �iles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 4 / 7

  6. Look at a picture instead of C++ code! How to get a picture? Bosce, or boost::statechart extractor, is a command line tool to extract information about boost::statechart s from an arbitrary binary with debug symbols and transform it to a user-friendly form, e.g. UML diagrams. https://github.com/kanje/bosce Solution What to do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 5 / 7

  7. Bosce, or boost::statechart extractor, is a command line tool to extract information about boost::statechart s from an arbitrary binary with debug symbols and transform it to a user-friendly form, e.g. UML diagrams. https://github.com/kanje/bosce Solution What to do? Look at a picture instead of C++ code! How to get a picture? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 5 / 7

  8. https://github.com/kanje/bosce Solution What to do? Look at a picture instead of C++ code! How to get a picture? Bosce, or boost::statechart extractor, is a command line tool to extract information about boost::statechart s from an arbitrary binary with debug symbols and transform it to a user-friendly form, e.g. UML diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 5 / 7

  9. https://github.com/kanje/bosce Solution What to do? Look at a picture instead of C++ code! How to get a picture? Bosce, or boost::statechart extractor, is a command line tool to extract information about boost::statechart s from an arbitrary binary with debug symbols and transform it to a user-friendly form, e.g. UML diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 5 / 7

  10. $ g++ demo.cpp -o demo StopWatch $ xdg-open uml.png $ bosce demo -l $ plantuml uml.pu Available state-machines: $ bosce demo -s StopWatch > uml.pu Example Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 6 / 7

  11. $ g++ demo.cpp -o demo StopWatch $ xdg-open uml.png $ bosce demo -l $ plantuml uml.pu Available state-machines: $ bosce demo -s StopWatch > uml.pu Example Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 6 / 7

  12. Thank you! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Antons Jel̦kins boost::statechart visualisation Meeting C++ 2019 7 / 7

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend