rtt-2.0-mainline major overhaul.

This to inform you that the rtt-2.0-mainline has been refactored
pretty insanely.It took me a whole week, and several hours of night
work. The result is:

* RTT 'non-user' headers are found into subdirectories with the names
'os, base, interface, internal, types, plugin, scripting, marsh,
corba, dev and extras.'
* Each of the classes in these headers are found in the same namespace
name as the subdirectory name.
So 'os/' -> 'namespace os' etc.
* Each namespace now has a rtt-<namespace name>-fwd.hpp which contains
all forward declarations. This file is auto-generated.
* The special namespace 'RTT::detail' includes all classes from the
subnamespaces of RTT. So for example, writing
RTT::base::RunnableInterface is equivalent to
RTT::detail::RunnableInterface. The advantage is that when you/RTT
have a .cpp file, you can #include <rtt/rtt-detail-fwd.hp

in
addition to any header located in a rtt/* subdirectory. Finally you
can write 'using namespace detail;', and just use the class names,
without knowing 'is this base ?' / 'is this internal?'/... Also, this
keeps some backwards compatibility going (detail was used for this
purpose in 1.x as well).

The main overspanning namespace remains RTT, and the user visible code
resides in this namespace. If you used nothing from 'extras' your user
code should still work, except for the DataFlow changes.

One of the reasons that it took so long is that I tried to split most
cases of multiple classes in one header into one class per headers and
I had to get rid of all random placed forward declarations, which are
replaced by rtt-<namespace name>-fwd.hpp. The new data flow headers
got this treatment as well and also various older stuff. CORBA classes
are still problamatic, because some classes in RTT::corba have the
same name as in RTT::somewhereelse. It works for now, but I will most
likely rename all CORBA structs and interfaces (the stuff defined in
the idl) with a 'C' prefix. Having constantly two classes with the
same name in each and every corba header/cpp file is asking for
trouble (and also confuses Doxygen).

Also, the SingleThread/PeriodicThread was removed (but not
PeriodicActivity, which now uses os::Thread). At the same time, the
unit tests were updated to keep working. In the end, very single file
in RTT and unit tests was touched, so the patch is huge and very hard
to review. 95% of the changes were done by scripts, dumb scripts
unfortunately, but this was the only option to change a thousand
files. The unit tests give me confidence to ask people to try this out
(and no functionality was changed, except removing the old *Thread
classes).

Note that rtt-2.0-mainline contains the new Data flow code, OCL has
not been brought into line with that code yet.

This is our new base to start from. You can browse the new structure
at: http://github.com/psoetens/orocos-rtt/tree/rtt-2.0-mainline
and the generated Doxygen docs at
http://www.orocos.org/devel/rtt/rtt-2.0-mainline/doc/api/html/

Quick summary:
rtt/ -> TaskContext.hpp, Activity.hpp, Method.hpp,...
rtt/base -> common base classes for most classes in RTT. ie
PropertyBase, DataSourceBase, RunnableInterface, ProgramInterface,...
rtt/interface -> interface building classes of a TaskContext:
CommandRepository, AttributeRepository, EventService,...
rtt/os -> Mutex.hpp, Thread.hpp, fosi.h,...
rtt/internal -> How we implement things, most heavy template code
user's don't want to see or smell.
rtt/marsh -> Property to XML,.. marshalling
rtt/scripting -> All classes for scripting/parsing, includes
StateMachine, FunctionGraph, Parser etc
rtt/extras -> Alternative implementations of some of the base::
interfaces. SimulationActivity, Timer, SlaveActivity,...
rtt/extras/dev -> The optional IO interface definitions
rtt/plugin -> Defines/will contain the plugin infrastructure. Plugin.hpp
rtt/types -> for the TemplateTypeInfo and type system stuff
rtt/transports/corba -> for the corba library. ControlTaskProxy etc.

I expect some minor changes still. For example, I moved TimeService
into os:: but Timer into extras::. I'll probably move Timer into os::
as well. Other suggestions greatly appreciated.

Practical consequences for user code

There needs to be a search&replace for the following strings:

'namespace os' ->'namespace OS'
' OS::' -> ' os::'
'namespace Corba' ->'namespace corba'
' Corba::' -> ' corba::'
'#include <rtt/corba/...>' -> '#include <rtt/transports/corba/...>'
'RTT::TimeService' -> 'RTT::os::TimeService'
'RTT::SlaveActivity' -> 'RTT::extras::SlaveActivity' (and all other
files in extras)
'RTT::NonPeriodicActivity' -> 'RTT::Activity'
'RTT::os::PeriodicThread/SingleThread' -> 'RTT::os::Thread'
'RTT::types()' -> 'RTT::types::Types()'
'RTT::TypeInfoRepository' -> 'RTT::types::TypeInfoRepository'
'RTT::ReadDataPort' -> 'RTT::InputPort'
'RTT::WriteDataPort' -> 'RTT::OutputPort'
...

I'm collecting the changes at:
http://www.orocos.org/wiki/rtt/rtt-20/rtt-20-renaming-table

I have a script doing this for RTT. I'll adapt it for OCL (= user
code) and then post it to the list.

Peter

rtt-2.0-mainline major overhaul.

On Mon, Aug 17, 2009 at 03:27:21PM +0200, Peter Soetens wrote:
> This to inform you that the rtt-2.0-mainline has been refactored
> pretty insanely.It took me a whole week, and several hours of night

Good, as long as you aren't going insane...

I get the following error compiling top-of-git rtt-2.0-mainline:

[ 0%] Building CXX object src/CMakeFiles/orocos-rtt-dynamic_gnulinux.dir/marsh/TinyDemarshaller.cpp.o
cd /home/mk/src/git/gitorocos/orocos-rtt/src && /usr/bin/c++ -DRTT_DLL_EXPORT -DOROCOS_TARGET=gnulinux -O2 -DNDEBUG -fPIC -I/home/mk/src/git/gitorocos/orocos-rtt/src -I/home/mk/src/git/gitorocos/orocos-rtt/src/os -I/home/mk/src/git/gitorocos/orocos-rtt/src/os/gnulinux -o CMakeFiles/orocos-rtt-dynamic_gnulinux.dir/marsh/TinyDemarshaller.cpp.o -c /home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:220: error: expected ‘,’ or ‘...’ before ‘*’ token
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:220: error: ISO C++ forbids declaration of ‘TiXmlAttribute’ with no type
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:305: error: ‘TiXmlNode’ has not been declared
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp: In member function ‘void RTT::marsh::Tiny2CPFHandler::startElement(const char*, int)’:
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:230: error: ‘attributes’ was not declared in this scope
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:247: error: ‘attributes’ was not declared in this scope
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp: In member function ‘bool RTT::marsh::Tiny2CPFHandler::populateBag(int*)’:
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:310: error: ‘TiXmlNode’ was not declared in this scope
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:310: error: ‘pChild’ was not declared in this scope
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:311: error: ‘TiXmlText’ was not declared in this scope
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:311: error: ‘pText’ was not declared in this scope
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:312: error: request for member ‘Type’ in ‘* pParent’, which is of non-class type ‘int’
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:316: error: ‘TiXmlNode’ is not a class or namespace
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:318: error: request for member ‘Value’ in ‘* pParent’, which is of non-class type ‘int’
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:318: error: request for member ‘ToElement’ in ‘* pParent’, which is of non-class type ‘int’
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:321: error: request for member ‘FirstChild’ in ‘* pParent’, which is of non-class type ‘int’
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:332: error: ‘TiXmlNode’ is not a class or namespace
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:333: error: request for member ‘ToText’ in ‘* pParent’, which is of non-class type ‘int’
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:338: error: ‘TiXmlNode’ is not a class or namespace
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:339: error: ‘TiXmlNode’ is not a class or namespace
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:340: error: ‘TiXmlNode’ is not a class or namespace
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:341: error: ‘TiXmlNode’ is not a class or namespace
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp: In member function ‘virtual bool RTT::marsh::TinyDemarshaller::deserialize(RTT::PropertyBag&)’:
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:393: error: no matching function for call to ‘RTT::marsh::Tiny2CPFHandler::populateBag(RTT::detail::TiXmlNode*)’
/home/mk/src/git/gitorocos/orocos-rtt/src/marsh/TinyDemarshaller.cpp:305: note: candidates are: bool RTT::marsh::Tiny2CPFHandler::populateBag(int*)
make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_gnulinux.dir/marsh/TinyDemarshaller.cpp.o] Error 1
make[2]: Leaving directory `/home/mk/src/git/gitorocos/orocos-rtt'

Ideas?

Regards
Markus
--
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

rtt-2.0-mainline major overhaul.

On Tue, Aug 18, 2009 at 10:10, Markus
Klotzbuecher<markus [dot] klotzbuecher [..] ...> wrote:
> On Mon, Aug 17, 2009 at 03:27:21PM +0200, Peter Soetens wrote:
>> This to inform you that the rtt-2.0-mainline has been refactored
>> pretty insanely.It took me a whole week, and several hours of night
>
> Good, as long as you aren't going insane...
>
> I get the following error compiling top-of-git rtt-2.0-mainline:

Oops, only tested with Xerces. I pushed the namespace fix to github.

FYI LXRT, Xenomai, macosx,... are also still untested, but taken into
account during the renaming...

Peter

rtt-2.0-mainline major overhaul.

On Aug 18, 2009, at 04:27 , Peter Soetens wrote:

> On Tue, Aug 18, 2009 at 10:10, Markus
> Klotzbuecher<markus [dot] klotzbuecher [..] ...> wrote:
>> On Mon, Aug 17, 2009 at 03:27:21PM +0200, Peter Soetens wrote:
>>> This to inform you that the rtt-2.0-mainline has been refactored
>>> pretty insanely.It took me a whole week, and several hours of night
>>
>> Good, as long as you aren't going insane...
>>
>> I get the following error compiling top-of-git rtt-2.0-mainline:
>
> Oops, only tested with Xerces. I pushed the namespace fix to github.
>
> FYI LXRT, Xenomai, macosx,... are also still untested, but taken into
> account during the renaming...

Yes, yes ... I get the hint ... ;-)

rtt-2.0-mainline major overhaul.

On Aug 18, 2009, at 07:15 , S Roderick wrote:

> On Aug 18, 2009, at 04:27 , Peter Soetens wrote:
>
>> On Tue, Aug 18, 2009 at 10:10, Markus
>> Klotzbuecher<markus [dot] klotzbuecher [..] ...> wrote:
>>> On Mon, Aug 17, 2009 at 03:27:21PM +0200, Peter Soetens wrote:
>>>> This to inform you that the rtt-2.0-mainline has been refactored
>>>> pretty insanely.It took me a whole week, and several hours of night
>>>
>>> Good, as long as you aren't going insane...
>>>
>>> I get the following error compiling top-of-git rtt-2.0-mainline:
>>
>> Oops, only tested with Xerces. I pushed the namespace fix to github.
>>
>> FYI LXRT, Xenomai, macosx,... are also still untested, but taken into
>> account during the renaming...
>
> Yes, yes ... I get the hint ... ;-)

Close ... but no cigar for macosx.

Attached patches are required, most of which are recent patches from
master or my corba set from the other day. Builds orocos-rtt-
macos.dylib succesfully, but is unable to build the corba library due
to significant issues in config/FindOmniORB.cmake. This file needs to
be brought up to date with other recent changes - basically, it is not
passing out the library list into CORBA_LIBRARIES and hence orocos-rtt-
corba-macosx.dylib has no omniORB libraries to link against. Bad.

Again ... my early git days so do let me know if these patches are bad/
wrong in any way ...
Stephen

rtt-2.0-mainline major overhaul.

On Wed, Aug 19, 2009 at 02:12, S Roderick<kiwi [dot] net [..] ...> wrote:
> On Aug 18, 2009, at 07:15 , S Roderick wrote:
>
>> On Aug 18, 2009, at 04:27 , Peter Soetens wrote:
>>
>>> On Tue, Aug 18, 2009 at 10:10, Markus
>>> Klotzbuecher<markus [dot] klotzbuecher [..] ...> wrote:
>>>>
>>>> On Mon, Aug 17, 2009 at 03:27:21PM +0200, Peter Soetens wrote:
>>>>>
>>>>> This to inform you that the rtt-2.0-mainline has been refactored
>>>>> pretty insanely.It took me a whole week, and several hours of night
>>>>
>>>> Good, as long as you aren't going insane...
>>>>
>>>> I get the following error compiling top-of-git rtt-2.0-mainline:
>>>
>>> Oops, only tested with Xerces. I pushed the namespace fix to github.
>>>
>>> FYI LXRT, Xenomai, macosx,... are also still untested, but taken into
>>> account during the renaming...
>>
>> Yes, yes ... I get the hint ... ;-)
>
> Close ... but no cigar for macosx.
>
> Attached patches are required, most of which are recent patches from master
> or my corba set from the other day. Builds orocos-rtt-macos.dylib
> succesfully, but is unable to build the corba library due to significant
> issues in config/FindOmniORB.cmake. This file needs to be brought up to date
> with other recent changes - basically, it is not passing out the library
> list into CORBA_LIBRARIES and hence orocos-rtt-corba-macosx.dylib has no
> omniORB libraries to link against. Bad.
>
> Again ... my early git days so do let me know if these patches are bad/wrong
> in any way ...
> Stephen

Hmm, these patches were not taken against the latest rtt-2.0-mainline
? They apply mostly but it looks like they are meant for RTT 1.10
instead (looking at the location of the files).
>From which branch did you extract these files ?

Peter

rtt-2.0-mainline major overhaul.

On Aug 20, 2009, at 10:25 , Peter Soetens wrote:

> On Wed, Aug 19, 2009 at 02:12, S Roderick<kiwi [dot] net [..] ...> wrote:
>> On Aug 18, 2009, at 07:15 , S Roderick wrote:
>>
>>> On Aug 18, 2009, at 04:27 , Peter Soetens wrote:
>>>
>>>> On Tue, Aug 18, 2009 at 10:10, Markus
>>>> Klotzbuecher<markus [dot] klotzbuecher [..] ...> wrote:
>>>>>
>>>>> On Mon, Aug 17, 2009 at 03:27:21PM +0200, Peter Soetens wrote:
>>>>>>
>>>>>> This to inform you that the rtt-2.0-mainline has been refactored
>>>>>> pretty insanely.It took me a whole week, and several hours of
>>>>>> night
>>>>>
>>>>> Good, as long as you aren't going insane...
>>>>>
>>>>> I get the following error compiling top-of-git rtt-2.0-mainline:
>>>>
>>>> Oops, only tested with Xerces. I pushed the namespace fix to
>>>> github.
>>>>
>>>> FYI LXRT, Xenomai, macosx,... are also still untested, but taken
>>>> into
>>>> account during the renaming...
>>>
>>> Yes, yes ... I get the hint ... ;-)
>>
>> Close ... but no cigar for macosx.
>>
>> Attached patches are required, most of which are recent patches
>> from master
>> or my corba set from the other day. Builds orocos-rtt-macos.dylib
>> succesfully, but is unable to build the corba library due to
>> significant
>> issues in config/FindOmniORB.cmake. This file needs to be brought
>> up to date
>> with other recent changes - basically, it is not passing out the
>> library
>> list into CORBA_LIBRARIES and hence orocos-rtt-corba-macosx.dylib
>> has no
>> omniORB libraries to link against. Bad.
>>
>> Again ... my early git days so do let me know if these patches are
>> bad/wrong
>> in any way ...
>> Stephen
>
> Hmm, these patches were not taken against the latest rtt-2.0-mainline
> ? They apply mostly but it looks like they are meant for RTT 1.10
> instead (looking at the location of the files).
> From which branch did you extract these files ?
>
> Peter

I cherry-picked from my v1.x corba branch, applied to my-rtt-2.0-
mainline branch tracking your rtt-2.0-mainline, and then sent you the
patches from my-rt-2.0-mainline. Not the right thing to do? The same
patches need be on the 1.x and 2.x branches, I believe.

Stephen

rtt-2.0-mainline major overhaul.

On Thu, Aug 20, 2009 at 17:37, Stephen Roderick<kiwi [dot] net [..] ...> wrote:
> On Aug 20, 2009, at 10:25 , Peter Soetens wrote:
>> Hmm, these patches were not taken against the latest rtt-2.0-mainline
>> ? They apply mostly but it looks like they are meant for RTT 1.10
>> instead (looking at the location of the files).
>> From which branch did you extract these files ?
>>
>> Peter
>
> I cherry-picked from my v1.x corba branch, applied to my-rtt-2.0-mainline
> branch tracking your rtt-2.0-mainline, and then sent you the patches from
> my-rt-2.0-mainline. Not the right thing to do? The same patches need be on
> the 1.x and 2.x branches, I believe.

They belong on both, but it looks like you ran the git format-patch
against the wrong branch. Just in case, I recommend this PS1 path
setting I got from Markus and that I found indispensable:

PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1
"(%s)") \[\033[01;34m\]$\[\033[00m\] '

copy/paste it in your open bash shell, and cd to a git directory.

Peter

rtt-2.0-mainline major overhaul.

On Aug 20, 2009, at 12:19 , Peter Soetens wrote:

> On Thu, Aug 20, 2009 at 17:37, Stephen Roderick<kiwi [dot] net [..] ...>
> wrote:
>> On Aug 20, 2009, at 10:25 , Peter Soetens wrote:
>>> Hmm, these patches were not taken against the latest rtt-2.0-
>>> mainline
>>> ? They apply mostly but it looks like they are meant for RTT 1.10
>>> instead (looking at the location of the files).
>>> From which branch did you extract these files ?
>>>
>>> Peter
>>
>> I cherry-picked from my v1.x corba branch, applied to my-rtt-2.0-
>> mainline
>> branch tracking your rtt-2.0-mainline, and then sent you the
>> patches from
>> my-rt-2.0-mainline. Not the right thing to do? The same patches
>> need be on
>> the 1.x and 2.x branches, I believe.
>
> They belong on both, but it looks like you ran the git format-patch
> against the wrong branch. Just in case, I recommend this PS1 path
> setting I got from Markus and that I found indispensable:
>
> PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1
> "(%s)") \[\033[01;34m\]$\[\033[00m\] '
>
> copy/paste it in your open bash shell, and cd to a git directory.
>
> Peter

Does that put the current git branch into your prompt? If so, I
already have that - hence, it was my own stupid fault for reading the
branch wrong, or I provided the wrong options to git diff!

Sorry
Stephen

rtt-2.0-mainline major overhaul.

On Mon, Aug 17, 2009 at 3:27 PM, Peter Soetens<peter [dot] soetens [..] ...> wrote:
> This to inform you that the rtt-2.0-mainline has been refactored
> pretty insanely.It took me a whole week, and several hours of night
> work.

I hope your wage is payed in terms of working hours instead of working
days then ;-)

[...]
> Note that rtt-2.0-mainline contains the new Data flow code, OCL has
> not been brought into line with that code yet.
>
> This is our new base to start from. You can browse the new structure
> at: http://github.com/psoetens/orocos-rtt/tree/rtt-2.0-mainline
> and the generated Doxygen docs at
> http://www.orocos.org/devel/rtt/rtt-2.0-mainline/doc/api/html/

Are there already some docs about "the new data flow code". I've had
a look at the API docs mentioned above, but the RTT::InputPort and
RTT::OutputPort don't even appear there (except on the front page
where they are mentioned (but not href-ed)?

Thanks,

Klaas

rtt-2.0-mainline major overhaul.

On Mon, Aug 17, 2009 at 16:12, Klaas Gadeyne<klaas [dot] gadeyne [..] ...> wrote:
> On Mon, Aug 17, 2009 at 3:27 PM, Peter Soetens<peter [dot] soetens [..] ...> wrote:
>> This to inform you that the rtt-2.0-mainline has been refactored
>> pretty insanely.It took me a whole week, and several hours of night
>> work.
>
> I hope your wage is payed in terms of working hours instead of working
> days then ;-)

How could you doubt that ! Aren't you ?

>
> [...]
>> Note that rtt-2.0-mainline contains the new Data flow code, OCL has
>> not been brought into line with that code yet.
>>
>> This is our new base to start from. You can browse the new structure
>> at: http://github.com/psoetens/orocos-rtt/tree/rtt-2.0-mainline
>> and the generated Doxygen docs at
>> http://www.orocos.org/devel/rtt/rtt-2.0-mainline/doc/api/html/
>
> Are there already some docs about "the new data flow code".  I've had
> a look at the API docs mentioned above, but the RTT::InputPort and
> RTT::OutputPort don't even appear there (except on the front page
> where they are mentioned (but not href-ed)?

Sylvain is preparing a patch (at least, he promised to :-)

Peter