Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Statechart and Simulink
From: Derek Ditch (derek.ditch+boost_at_[hidden])
Date: 2008-11-21 19:17:19


Andreas Huber wrote:
> Hi Derek
>
>> I was wondering if there were any known issues with compiling using
>> Matlab's mex compiler (which in turn uses and links with gcc) and using
>> Boost.Statechart.
>
> No, unfortunately.
>
Andreas, thanks for the reply. It turns out this was a bug in my code.
  I first got around this by creating a dynamic library and accessing
the code that way. While it was a good lesson, it was a waste of my
time and a hack. I read about this technique on another site, where the
developers had some other issue with Matlab mangling their C++ when
compiled under Visual C++.

>> I've tried several things to figure out what is happening, but all I can
>> ascertain is that if I use the iterators state_begin() and state_end() to
>> access all internal states, the loop never executes.
>
> This however does not fit with my RTTI mechanism failure theory. Even if
> it did fail, after calling initiate() the range [state_begin(),
> state_end()) should still not be empty.

This turned out to be the problem. In my Matlab code, I failed to call
initiate. Therefore, none of the state transitions could occur. I
rewrote the code to call initiate and also to pass data through the events.

Thanks again for your quick response. I'll check my code better in the
future.

--
Derek

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net