constructor_add_initializer.xsl
Weaving Rule that adds an initializer to a constructor
- srcML element:
src:constructor - advice type:
add - codeModifier type:
initializer
Example
Base Code
Foo:Foo() { }
Code Modifier
<codeModifier type="initializer">
<text>_x(10)</text>
</codeModifier>Modified Code
Foo:Foo() : _x(10) { }
Examples in AspectX Sample Library
- Observer
Examples in AspectX Test Suite
- Bug_00000144
CVS Id:
Author:
ibirrer
Copyright:
2004, P&P Software GmbH
Match Templates Summary
Default copy template for constructor_move_initializerList
Move advices to the member_list element element
Match Templates Detail
Default copy template for constructor_move_initializerList
Parameters:
advices -
Move advices to the member_list element element
Parameters:
advices -
src:constructor[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='initializer']] (mode: weaving) - source
This template does the following:
- Checks if an initializer list (src:member_list) exist for the current constructor. If not, an initializer list is added including the advice
- If yes the advice is copied to the initializer list