This page lists the renamings/relocations done on the RTT 2.0 branch (available through gitorious on http://www.gitorious.org/orocos-toolchain/rtt/commits/master) and also offers the conversion scripts to do the renaming.
A note about headers/namespaces: If a header is in rtt/extras, the namespace will be RTT::extras and vice versa. A header in rtt/ has namespace RTT. Note: the OS namespace has been renamed to lowercase os. The Corba namespace has been renamed to lowercase corba.
mv to-rtt-2.0.pl.txt to-rtt-2.0.pl chmod a+x to-rtt-2.0.pl ./to-rtt-2.0.pl $(find . -name "*.cpp" -o -name "*.hpp")
Minor manual fixes may be expected after running this script. Be sure to have your sources version controlled, such that you can first test what the script does before permanently changing files.
tar xjf rtt2-converter-1.1.tar.bz2 cd rtt2-converter-1.1 make ./rtt2-converter Component.hpp Component.cpp
The script takes preferably both header and implementation of your component, but will also accept a single file. It needs both class definition and implementation to make its best guesses on how to convert. If all your code is in a .hpp or .cpp file, you only need to specify that file. If nothing is to be done, the file will remain the same, so you may 'accidentally' feed non-Orocos files, or a file twice.
To run this on a large codebase, you can do something similar to:
# Calls : ./rtt2-converter Component.hpp Component.cpp for each file in orocos-app for i in $(find /home/user/src/orocos-app -name "*.cpp"); do ./rtt2-converter $(dirname $i)/$(basename $i cpp)hpp $i; done # Calls : ./rtt2-converter Component.cpp for each .cpp file in orocos-app for i in $(find /home/user/src/orocos-app -name "*.cpp"); do ./rtt2-converter $i; done # Calls : ./rtt2-converter Component.hpp for each .hpp file in orocos-app for i in $(find /home/user/src/orocos-app -name "*.hpp"); do ./rtt2-converter $i; done
RTT 1.0 | RTT 2.0 | Comments |
RTT::PeriodicActivity | RTT::extras::PeriodicActivity | Use of RTT::Activity is prefered |
RTT::Timer | RTT::os::Timer | |
RTT::SlaveActivity, SequentialActivity, SimulationThread, IRQActivity, FileDescriptorActivity, EventDrivenActivity, SimulationActivity, ConfigurationInterface, Configurator, TimerThread | RTT::extras::... | EventDrivenActivity has been removed. |
RTT::OS::SingleThread, RTT::OS::PeriodicThread | RTT::os::Thread | Can do periodic and non-periodic and switch at run-time. |
RTT::TimeService | RTT::os::TimeService | |
RTT::DataPort,BufferPort | RTT::InputPort,RTT::OutputPort | Buffered/unbuffered is decided upon connection time. Only input/output is hardcoded. |
RTT::types() | RTT::types::Types() | The function name collided with the namespace name |
RTT::Toolkit* | RTT::types::Typekit* | More logical name |
RTT::Command | RTT::Operation | Create an 'OwnThread' operation type |
RTT::Method | RTT::Operation | Create an 'ClientThread' operation type |
RTT::Event | RTT::internal::Signal | Events are replaced by OutputPort or Operation, the Signal class is a synchonous-only callback manager. |
commands()->getCommand<T>() | provides()->getOperation() | get a provided operation, no template argument required |
commands()->addCommand() | provides()->addOperation().doc("Description") | add a provided operation, document using .doc("doc").doc("a1","a1 doc")... |
methods()->getMethod<T>() | provides()->getOperation() | get a provided operation, no template argument required |
methods()->addMethod() | provides()->addOperation().doc("Description") | add a provided operation, document using .doc("doc").doc("a1","a1 doc")... |
attributes()->getAttribute<T>() | provides()->getAttribute() | get a provided attribute, no template argument required |
attributes()->addAttribute(&a) | provides()->addAttribute(a) | add a provided attribute, passed by reference, can now also add a normal member variable. |
properties()->getProperty<T>() | provides()->getProperty() | get a provided property, no template argument required |
properties()->addProperty(&p) | provides()->addProperty(p).doc("Description") | add a provided property, passed by reference, can now also add a normal member variable. |
events()->getEvent<T>() | ports()->getPort() OR provides()->getOperation<T>() | Event<T> was replaced by OutputPort<T> or Operation<T> |
ports()->addPort(&port, "Description") | ports()->addPort( port ).doc("Description") | Takes argument by reference and documents using .doc("text"). |
RTT 1.0 | RTT 2.0 | Comments |
scripting() | getProvider<Scripting>("scripting") | Returns a RTT::Scripting object. Also add #include <rtt/scripting/Scripting.hpp> |
RTT 1.0 | RTT 2.0 | Comments |
marshalling() | getProvider<Marshalling>("marshalling") | Returns a RTT::Marshalling object. Also add #include <rtt/marsh/Marshalling.hpp> |
RTT::Marshaller | RTT::marsh::MarshallingInterface | Normally not needed for normal users. |
RTT::Demarshaller | RTT::marsh::DemarshallingInterface | Normally not needed for normal users. |
RTT 1.0 | RTT 2.0 | Comments |
RTT::Corba::* | RTT::corba::C* | Each proxy class or idl interface starts with a 'C' to avoid confusion with the same named RTT C++ classes |
RTT::Corba::ControlTaskServer | RTT::corba::TaskContextServer | renamed for consistency. |
RTT::Corba::ControlTaskProxy | RTT::corba::TaskContextProxy | renamed for consistency. |
RTT::Corba::Method,Command | RTT::corba::COperationRepository,CSendHandle | No need to create these helper objects, call COperationRepository directly |
RTT::Corba::AttributeInterface,Expression,AssignableExpression | RTT::corba::CAttributeRepository | No need to create expression objects, query/use CAttributeRepository directly. |
Attachment | Size |
---|---|
class-dump.txt | 7.89 KB |
headers.txt | 10.17 KB |
to-rtt-2.0.pl.txt | 4.78 KB |