2014-09-10 - dispatcher in C++14

issue cover few days ago a new issue of Programista Magazine has been released. it contains an article, explaining in a great detail my concept of dispatcher pattern implementation, that allows very compact code on user side. example dispatcher for 3 messages can look like this:

struct MyDispatcher: public AutoDispatcher<MyDispatcher, Msg1, Msg2, Msg3>
{
  void handle(Msg1 const& m) { /* handle code */ }
  void handle(Msg2 const& m) { /* handle code */ }
  void handle(Msg3 const& m) { /* handle code */ }
};

AutoDispatcher is a part of BUT library i started recently. note that it also allows one-line mock creation.

the idea has been also presented on Wrocław's C++ users group, as an (almost) lightning talk. there is good chance, it will also be presented to the wider audience in Wrocław, around the end of 2014. stay tuned! :)

blog/2014/09/10/dispatcher_in_c_14.txt · Last modified: 2014/09/10 20:10 by basz
Back to top
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0