Patch to dump diagnostic data for toolkit type name mismatch

If you misname a type registered with RTT and a transport, this will dump diagnostic data to help figure out what is actually registered. Otherwise you just have an assert() and no real data to go on.

HTH
S

AttachmentSize
patch-rtt-typedump.txt4.03 KB

Patch to dump diagnostic data for toolkit type name mismatch

On Monday 22 December 2008 15:37:36 kiwi [dot] net [..] ... wrote:
> If you misname a type registered with RTT and a transport, this will dump
> diagnostic data to help figure out what is actually registered. Otherwise
> you just have an assert() and no real data to go on.

'dump' is a cryptic function name. In Orocos speak, we would use
TypeInfo::getTransportNames()[*] and TypeInfoRepository::logTypeInfo()...
or something similar. Also Doxygen documentation has the form
/** ... */
or
//! ...

Somewhat (un)related
I was also thinking of adding a global method
RTT::types() { return TypeInfoRepository::Instance(); }

for usability's sake. favors / cons ?

Peter

[*] Which would return a std::vector, see DataFlowInterface,
EventSercie,... for example.

Patch to dump diagnostic data for toolkit type name mismatch

On Dec 22, 2008, at 11:13 , Peter Soetens wrote:

> On Monday 22 December 2008 15:37:36 kiwi [dot] net [..] ... wrote:
>> If you misname a type registered with RTT and a transport, this
>> will dump
>> diagnostic data to help figure out what is actually registered.
>> Otherwise
>> you just have an assert() and no real data to go on.
>
> 'dump' is a cryptic function name. In Orocos speak, we would use
> TypeInfo::getTransportNames()[*] and
> TypeInfoRepository::logTypeInfo()...
> or something similar. Also Doxygen documentation has the form
> /** ... */
> or
> //! ...
>
> Somewhat (un)related
> I was also thinking of adding a global method
> RTT::types() { return TypeInfoRepository::Instance(); }
>
> for usability's sake. favors / cons ?
>
> Peter
>
> [*] Which would return a std::vector, see
> DataFlowInterface,
> EventSercie,... for example.

Of course this, using a std::vector<> (be it string or int), is not-
realtime compatible ... then again, probably std::stringstream is the
same underneath too.
S

Patch to dump diagnostic data for toolkit type name mismatch

On Monday 22 December 2008 17:53:25 S Roderick wrote:
> On Dec 22, 2008, at 11:13 , Peter Soetens wrote:
> >
> > [*] Which would return a std::vector, see
> > DataFlowInterface,
> > EventSercie,... for example.
>
> Of course this, using a std::vector<> (be it string or int), is not-
> realtime compatible ... then again, probably std::stringstream is the
> same underneath too.

All setup functions and some query function in Orocos are not real-time.
That's fine. If I were to tag real-time or not real-time functions (as you
suggested once iirc), I would only tag the realtime functions, it would be
less work :-)

Peter

Patch to dump diagnostic data for toolkit type name mismatch

On Dec 22, 2008, at 11:13 , Peter Soetens wrote:

> On Monday 22 December 2008 15:37:36 kiwi [dot] net [..] ... wrote:
>> If you misname a type registered with RTT and a transport, this
>> will dump
>> diagnostic data to help figure out what is actually registered.
>> Otherwise
>> you just have an assert() and no real data to go on.
>
> 'dump' is a cryptic function name. In Orocos speak, we would use
> TypeInfo::getTransportNames()[*] and
> TypeInfoRepository::logTypeInfo()...
> or something similar. Also Doxygen documentation has the form
> /** ... */
> or
> //! ...

I get the logTypeInfo(), but not sure about the getTransportNames().
Is this supposed to replace what I called TypeInfo::dump()? If so,
names aren't available at this point, only protocol ID's. We could
change it to return a std::vector full of protocol ID's? When I
understand this, I'll send an updated patch.

Also, what piece of code is the Doxygen comment aimed at?

> Somewhat (un)related
> I was also thinking of adding a global method
> RTT::types() { return TypeInfoRepository::Instance(); }
>
> for usability's sake. favors / cons ?

It would make typing shorter, but otherwise I have no opinion either
way.
S

Patch to dump diagnostic data for toolkit type name mismatch

On Monday 22 December 2008 17:52:03 S Roderick wrote:
> On Dec 22, 2008, at 11:13 , Peter Soetens wrote:
> > On Monday 22 December 2008 15:37:36 kiwi [dot] net [..] ... wrote:
> >> If you misname a type registered with RTT and a transport, this
> >> will dump
> >> diagnostic data to help figure out what is actually registered.
> >> Otherwise
> >> you just have an assert() and no real data to go on.
> >
> > 'dump' is a cryptic function name. In Orocos speak, we would use
> > TypeInfo::getTransportNames()[*] and
> > TypeInfoRepository::logTypeInfo()...
> > or something similar. Also Doxygen documentation has the form
> > /** ... */
> > or
> > //! ...
>
> I get the logTypeInfo(), but not sure about the getTransportNames().
> Is this supposed to replace what I called TypeInfo::dump()?

Yes. I thought dump returned names, but it seems to be numbers. My mistake.

> If so,
> names aren't available at this point, only protocol ID's. We could
> change it to return a std::vector full of protocol ID's? When I
> understand this, I'll send an updated patch.

So it's not getTransportNames(), I mixed up different interfaces
TypeTransporter (the marshaller) and TransportRegistrator (the 'plugin') . I
even start wondering if my previous suggestions about the type transport
Import API were making sense...

Anyway, If I were in your position, I would extend TypeTransporter such that
it returns the protocol ID and protocol name (CorbaTemplateProtocol would
need to be extended then as well). Then you could make dump() return the
names after all.

>
> Also, what piece of code is the Doxygen comment aimed at?

Just every function that is added to the class declaration ie dump() is not
ok, dumpToLog() is ok.

Peter

Patch to dump diagnostic data for toolkit type name mismatch

On Dec 22, 2008, at 15:40 , Peter Soetens wrote:

> On Monday 22 December 2008 17:52:03 S Roderick wrote:
>> On Dec 22, 2008, at 11:13 , Peter Soetens wrote:
>>> On Monday 22 December 2008 15:37:36 kiwi [dot] net [..] ... wrote:
>>>> If you misname a type registered with RTT and a transport, this
>>>> will dump
>>>> diagnostic data to help figure out what is actually registered.
>>>> Otherwise
>>>> you just have an assert() and no real data to go on.
>>>
>>> 'dump' is a cryptic function name. In Orocos speak, we would use
>>> TypeInfo::getTransportNames()[*] and
>>> TypeInfoRepository::logTypeInfo()...
>>> or something similar. Also Doxygen documentation has the form
>>> /** ... */
>>> or
>>> //! ...
>>
>> I get the logTypeInfo(), but not sure about the getTransportNames().
>> Is this supposed to replace what I called TypeInfo::dump()?
>
> Yes. I thought dump returned names, but it seems to be numbers. My
> mistake.
>
>> If so,
>> names aren't available at this point, only protocol ID's. We could
>> change it to return a std::vector<int> full of protocol ID's? When I
>> understand this, I'll send an updated patch.
>
> So it's not getTransportNames(), I mixed up different interfaces
> TypeTransporter (the marshaller) and TransportRegistrator (the
> 'plugin') . I
> even start wondering if my previous suggestions about the type
> transport
> Import API were making sense...
>
> Anyway, If I were in your position, I would extend TypeTransporter
> such that
> it returns the protocol ID and protocol name (CorbaTemplateProtocol
> would
> need to be extended then as well). Then you could make dump() return
> the
> names after all.

Updated patch against rtt v1.6.2.

I did not extend RTT to include protocol names. I figured we should
talk about that first ... but it won't take much to extend this new
code to cover that.

S

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Patch to dump diagnostic data for toolkit type name mismatch

If you misname a type registered with RTT and a transport, this will dump diagnostic data to help figure out what is actually registered. Otherwise you just have an assert() and no real data to go on.

HTH
S

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm