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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

file:///C:/uml/BOUML/bouml_3.0/doc/TOUT.html311 of 378 07/10/2007 15:55For instance you want to define the external class string and you want to automatically generate #include followed by usingnamespace std; you just have to create the class string, to set it external in C++ and to have the declaration form :${name}#include using namespace std;If you don't want to use the namespace and ask to write std::string the declaration must be :std::${name}#include OperationThe C++ definition of an operation is set through the Uml and C++ tabs of the operation dialog.The indentation of the first line of the declaration/definition give the indentation added to the visibility specification in the class definitionfor all the operation declaration/definition (except for the pre-processor forms beginning by # whose are placed at the beginning of theline).In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :${comment} is replaced by the description of the operation adding //${description} is replaced by the operation description without adding //${static} produce static when the operation is a class operation (see the UML tab)${const} produce const when the operation is const${volatile} produce volatile when the operation is volatile${friend} produce friend when the operation is friend${virtual} produce virtual when the oprration is virtual${inline} produce inline when the operation is inline${type} is replaced by the returned value type (see the UML tab)${name} is replaced by the operation's name${class} is replaced by the name of the class containing the operation.${(} and ${)} produce ( and ), but there are also a mark for BOUML to find the parameters list${abstract} produce the string = 0 when the operation is abstract (see the UML tab)${staticnl} produce a line break when the operation is static, else an empty string.${t} and ${p}produce the type and the name of each parameter (count from 0), this allows you to remove a parameter, add type modifiers etc ...${throw} is replaced by the form throw (...) when at least an exception is defined in the UML tab. It is also possible to producethrow() when there is no exception depending on the generation settings.${body} is replaced by the body of the operation, this macro may also be replaced by the body itself (BOUML use this way for theget and set operations associated to a relation/attribute). The usage of ${body} has a great advantage : when you hit Defaultdefinition or From declarationthe body is not cleared ! At least BOUML share the declaration and definition forms of the operations (and other objects) tominimize the needed memory size, ${body} help for this ! The indentation of the keyword ${body} is added at the beginning ofeach line except the ones starting by a '#' or when the previous one ends by '\'.

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

Saved successfully!

Ooh no, something went wrong!