Re: No exceptions!

Peter Soetens <[email protected]>
Newsgroups gmane.science.robotics.orocos.user
Organization KU Leuven
Message-ID <[email protected]>
On Tuesday 05 March 2002 00:01, you wrote:
> Hi.
> I guess we cannot use exceptions in the API:s and object definitions since
> the realtime parts cannot handle it?
> (At least that was one of the things I picked up from Peters seminar here
> at KTH last Thursday.)

this fact can be hidden for the API user.  STL provides this by defining 
__throw(), __try(),... macros which are wrapers to the real try throw catch 
methods or to empty function calls when STL_NO_EXCEPTIONS is defined.

I'm not sure how this must be done with the IDL discription (we can talk 
about that next week :-) ).

>
> This means we normally have to use the return values for status information
> instead of returning more "useful" stuff;-(

returning status information (which is indeed bad programming practice if you 
got exceptions at hand) is only required for the components that must be able 
to run in the realtime part. I'd also prefer to signal "exceptions" through 
event mechanisms (this is on my TODO list).

Peter

>
> ./Anders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.