This aspect is defined in file: ../../AspectXLib/ParameterDatabase/ParameterDatabase/aspects/PointcutLibrary.ax
Aspect Description
This aspect contains pointcut definitions that are used by other aspects in the group.
It is one of the fours sample aspect programs that modifies the component to access
all its parameters from a parameter database by copy and one of the two aspect
programs that modifies the component to access
all its parameters from a parameter database by pointer.
This group of aspect programs show an example of how the implementation of selected classes in a certain code
base can be modified to change the way in which member variables are handled. In this example, all
member variables in the base code are moved to a dedicated object called parameter database
(see Parameter
Database Design Pattern).
The
DC_BasicDatabase
is used as a component that stores the parameter data of target class.
The DC_BasicDatabase class extends the abstract class
ParameterDatabase.
Both classes are defined and implemented in
OBS Framework.
This file contains pointcuts that are used by the other aspect programs in the group.
Aspect programs can link pointcuts defined in this file using
<include href="Pointcuts.xml"/>.
- Author:
- A. Pasetti, O. Rohlik
- See also:
- BaseParameter
- GetParameter
- SetParameter
- ParameterDatabaseByPointer
Pointcut Documentation
Points to the target class to be modified by this aspect program. This is a very
simple pointcut that captures all classes and then adds the restriction that the
name of the class must be equal to "SampleClass". Note that this pointcut points
to the class declaration only, not the class implementation. The class implementation
is captured by the targetImplementationUnit pointcut that points to the
implementation of the methods declared in the target class.
unit
targetImplementationUnit
(
source)
Points to the unit that contains the implementation of methods of the target class.
In srcML, a unit is a source file (a definition file, a declaration file,
or an inline file). This pointcut therefore identifies the source file
that may use member variables declared in the target method.
expr
anySampleClassExpr
(
source)
Points to all expressions used in target class implementation.
The expressions (srcML element expr) may be used in definitions
of methods, constructors and destructors.
unit
targetClassDeclaration
(
source)
Points to the unit that contains the declaration of the target class.
name
targetIntNameGetter
(
source)
Points to occurrences of member variables
_width and
_height.
This pointcut points to
name srcML elements that contain variables of type
int.
The only
int variables in our sample base code are
width and
_height.
These variables have to be explicitly listed in the constraint attribute of the pointcut
since the srcML doesn't provide type information for
name elements.
Additional constraint is imposed on
name elements.
Only those elements are chosen that
do not appear on the left side of assignments.
name
targetFloatNameGetter
(
source)
Points to occurrences of member variable
_flt.
This pointcut points to
name srcML elements that contain
float variables.
The only
float variable in our sample base code is
_flt.
This variable has to be explicitly listed in the constraint attribute of the pointcut
since srcML doesn't provide type information for
name elements.
Additional constraint is imposed on
name elements.
Only those elements are chosen that
do not appear on the left side of assignments.
name
targetIntNameSetter
(
source)
Points to occurrences of member variables
_width and
_height.
This pointcut points to
name srcML elements that contain
int variables.
The only
int variables in our sample base code are
width and
_height.
These variables have to be explicitly listed in the constraint attribute of the pointcut
since srcML doesn't provide type information for
name elements.
Additional constraint is imposed on
name elements.
Only those elements are chosen that
appear on the left side of assignments.
name
targetFloatNameSetter
(
source)
Points to occurrences of member variable
_flt.
This pointcut points to
name srcML elements that contain
float variables.
The only
float variable in our sample base code is
_flt.
This variable has to be explicitly listed in the constraint attribute of the pointcut
since srcML doesn't provide type information for
name elements.
Additional constraint is imposed on
name elements.
Only those elements are chosen that
appear on the left side of assignments.
expr
targetIntExprSetter
(
source)
Points to expression elements expr where the value of the integer (int) member variable is changed. Such expression
can be identified as those that have the member variable on the left side of an assignment expression
i.e. those that contain pointcut targetIntNameSetter.
In this pointcut we do not assume usage of increment and decrement operators
(e.g. i++ and --i).
expr
targetFloatExprSetter
(
source)
Points to expression elements expr where the value of the float member variable is changed.
Such expression
can be identified as those that have the member variable on the left side of an assignment expression
i.e. those that contain pointcut targetFloatNameSetter.
In this pointcut we do not assume usage of increment and decrement operators
(e.g. f++ and --f).
Advice Documentation