13.07.2015 Views

Bouml reference manual - Fedora Project Packages GIT repositories

Bouml reference manual - Fedora Project Packages GIT repositories

Bouml reference manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

file:///C:/uml/BOUML/bouml_3.0/doc/TOUT.html315 of 378 07/10/2007 15:55C++ reverseThe C++ code reverse is a plug-out directly written in C++, as the C++ generator.Note that the C++ code reversecannot be used as a C++ code round trip and doesn't allows to update already defined classes having at least one member. Furthermore thepreprocessing phase is not made by the C++ code reversewhose ignore all the preprocessor forms, but some substitutions may be asked, see at the end of this chapter.The C++ code reverse plug-out may be applied only on packages.When you start the C++ code reverse, it asks you for directories (enter the directories then choose cancel to start the reverse), then itreads all the sources placed under the selected directories and sub-directories. The sources read by the C++ code reverse are the oneshaving the extension specified in the generation settings. The tree formed by the directories and sub-directories produce an equivalent treeof sub-packages, on whose the needed class view and artifact view are made to support the classes and artifacts. When a type is<strong>reference</strong>d but not defined in the reverse files, a class having the same name is defined under an additional package named unknown.Obviously the C++ code reverse tries to produce the definitions made in BOUML at the artifact / class / operation / relation / attributelevels. When it is possible it creates a relation rather than an attribute.Except for the special case of the templates class definition like vector, a artifact is created for each type definition, then a futureC++ code generation may not produce a list of files similar to the reversed ones.A C function cannot be specified in UML, the C++ code reverse loses them (generating a warning) except the ones declared friend in aclass.The C++ code reverse works in two steps, during the first step it scans all the files to establish the list of defined types, then the secondstep may reverse the files. The first phase try to replace the missing #include management, but it is not enough because the files whoseare not under the selected directory (for instance the standard headers files !) are never taken into account and the synonym typesconfusing.When the C++ code reversehas a problem, for instance when it reads a C function definition, it produces a warning in the trace window. The trace windowautomatically opened by BOUML, it may also be <strong>manual</strong>ly opened through the Tools menu.To do simple substitution on the read files : edit the package where the C++ reverse will be started (perhaps the project itself) to add auser property (through the tab 'User') with the key #fileand the value must be the absolute pathname of a file. Each line of the specified file must contain :just an identifier : in this case this identifier will be ignored during reverse. This is like #define identifiera form identifier=value: in this case the identifier will replaced by the value during reverse. The value must a token, for instance an other identifier, a float,a string etc. This is like #define identifier value.Warning : the lines must not contains spaces or tabs.Previous : C++ generatorNext : Java generator

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!