[statechart] exception_translator < >

Hi all! Currently i'm working on a project and i'm using boost::state_chart for implementing my asyncrone statecharts. Everything seems ok so far. But i have a small problem. My used client library, which is handled in the statemachine, throws sometime an exception. I said to me: "Not a problem, i will use an exception_translator." At home i made a simple project under Linux/g++ 4.4 (-Wall -pedantic) and MSVC2008 . No problems. At work we use MSVC2005 SP1 and boost 1.42.0. There i cant compile my simple statechart example. (currently i dont have the error messages here at my PC). The documentation states at http://www.boost.org/doc/libs/1_42_0/libs/statechart/doc/tutorial.html#Excep... <----------------------------------------> Discriminating Exceptions .... Unfortunately, this idiom (using throw; inside a try block nested inside a catch block) does not work on at least one very popular compiler. If you have to use one of these platforms, you can pass a customized exception translator class to the state_machine class template. This will allow you to generate different events depending on the type of the exception. <----------------------------------------> and under http://www.boost.org/development/tests/release/developer/statechart.html All tests "pass" for MSVC2005SP1 but i can't find a exception_translator test there (or i'm too blind) ;) So my question: Is MSVC2005SP1 "this very popular compiler" which cant handle exception_translators? @Andreas: Thanks for that very useful library! :-D Best Regards Georg Gast

Hi Georg
At work we use MSVC2005 SP1 and boost 1.42.0. There i cant compile my simple statechart example. (currently i dont have the error messages here at my PC).
Strange. It should definitely compile, see below. Please provide the example and the compiler output.
So my question: Is MSVC2005SP1 "this very popular compiler" which cant handle exception_translators?
I don't remember whether it was 2005 or an even earlier version that had problems with exeception_translator, but I'm pretty sure that those problems did *not* manifest themselves at compile-time. Either programs crashed at runtime or silently did the wrong thing. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.

Am 05.05.2010 21:03, schrieb Andreas Huber:
At work we use MSVC2005 SP1 and boost 1.42.0. There i cant compile my simple statechart example. (currently i dont have the error messages here at my PC).
Strange. It should definitely compile, see below. Please provide the example and the compiler output.
So my question: Is MSVC2005SP1 "this very popular compiler" which cant handle exception_translators?
I don't remember whether it was 2005 or an even earlier version that had problems with exeception_translator, but I'm pretty sure that those problems did *not* manifest themselves at compile-time. Either programs crashed at runtime or silently did the wrong thing.
Hi Andreas, thanks for your answer! Today i had some time to investigate that in detail in my project. The error was a classical layer 8 problem ;) I made different statechart declarations with the exception_handler / fifo_scheduler and the initiate() function which i had overseen ;) So ... Problem solved :) Bye Georg
participants (2)
-
Andreas Huber
-
Georg gast