../../AspectXLib/car/Car/aspects/CarSyncWin.ax ../../AspectXLib/car/Car/aspects/CarSyncWin.ax#include <windows.h> and #include "MutexWrapper.h"MutexWrapper distributed together with other classes of car example.
In order to test the aspect, check the main() function in the
sample C++ code and uncommment three lines labled as to be commented out
(lines 42 to 44 in main.cpp).
Pointcuts | |
| class | syncClasses |
|
Points to all classes which have to be synchronized | |
| unit | syncClassesDef |
| Points to units (files) which contain the definitions of the methods
to be synchronized | |
| constructor | syncClassesConstrDef |
| Points to definition of a constructor of the class that contains methods
to be synchronized | |
| constructor_decl | syncClassesConstrDecl |
| Points to declaration of a constructor of the class to be synchronized | |
| function | lockedFunctions |
| Points to all functions in the class to be synchronized | |
Advices | |
| add | addConstrDecl |
| Adds construtor declaration to classes which are to be sychronized and do not have a constructor | |
| add | addConstrDef |
| Adds construtor definition if the constructor was not defined | |
| begin | beginLockFunction |
| Locks the mutex at the beginning of each method in each class to be synchronized | |
| add | addFields |
| Adds field variable shared_mutex that is used as a lock
to each class to be synchronized | |
| add | addIncludesToDeclaration |
| Adds appropriate header files to each file that contains classes to be synchronized | |
| add | addIncludesToDefinition |
| Adds appropriate header files to each definition file that contains definitions of methods
of classes to be synchronized | |
| begin | initializeMutex |
| Inserts a piece of code that initializes the lock | |
PetrolStation. Triplet: class add declaration
Local Pointcut: class (source)
Triplet: unit add definition
Local Pointcut: unit (source)
Triplet: function begin codeFragment
Refers to global pointcut: function lockedFunctions
Triplet: class add declaration
shared_mutex that is used as a lock
to each class to be synchronized. The field variable is of type HANDLE.Refers to global pointcut: class syncClasses
Triplet: unit add include
#include <windows.h> and
#include "MutexWrapper.h".Local Pointcut: unit (source)
Triplet: unit add include
#include <windows.h> and
#include "MutexWrapper.h".Refers to global pointcut: unit syncClassesDef
Triplet: constructor begin codeFragment
Refers to global pointcut: constructor syncClassesConstrDef