CarBeginEnd Aspect
[CarExample Group]

This aspect is defined in file: ../../AspectXLib/car/Car/aspects/CarBeginEnd.ax

Aspect Description

Sample aspect program for "car example" that inserts tracing instructions when a setter method with integer parameter is entered and when any setter method is left. In this example, the tracing message is output using a output stream that writes a message to the output device stating the name of the method and the name of the class to which it belongs. The methods that are to be modified by the aspect are identified using their name. These methods have to contain substring "set" in their name.
Author:
I. Birrer, O. Rohlik
See also:
CarPostCondition
CarPreCondition
CarSynchronizeWindows

Pointcuts

functionanySetFunction
 Points to all setter methods
functionsetIntFunctions
 Points to setter methods with int paramter
unitunits
 Point to units that contain setter methods

Advices

beginatBegin
 Inserts a print instruction at the beginning of the target method
endatEnd
  Inserts a print instruction at the beginning of the target method
addaddIncludes
  Inserts #include and namespace instructions to the unit (file)

Pointcut Documentation

function anySetFunction (source)
Points to all setter methods. These method are recognized as methods that contain substring "set" in the method name.
function setIntFunctions (source)
Points to setter methods with int paramter. These method are recognized as methods that contain substring "set" in the method name and have formal paramter of type int.
unit units (source)
Point to units that contain setter methods.

Advice Documentation

begin atBegin (source)

Triplet: function begin codeFragment

Inserts a print instruction at the beginning of the target method. The print instruction outputs the name of called method, the name of class and the value of int parameter. The names of the method, class and parameter are accessed using "dollar variables".

Refers to global pointcut: function setIntFunctions

end atEnd (source)

Triplet: function end codeFragment

Inserts a print instruction at the beginning of the target method. The print instruction outputs the name of called method and the name of class. The names of the method and class are accessed using "dollar variables".

Refers to global pointcut: function anySetFunction

add addIncludes (source)

Triplet: unit add include

Inserts #include and namespace instructions to the unit (file). Both instructions are necessary to use the output stream. The advice adds two lines of code at the beginning of unit: #include <iostream> and using namespace std;

Refers to global pointcut: unit units