📄 readme.txt
字号:
This directory contains examples for the use of AspectC++ with XMEM.
The AscpectC++ version is an alternative to the conventional macro
preprocessing. However, due to some limitations in AspectC++, the full
XMEM functionality still requires preprocessing to insert information
like name of calling function and location (file, line). Therefore two
different examples, with and without preprocessing, show how aspect
orientation can be applied.
Example1: "Pure" AspectC++ code that uses XMEM memory debugging functions
without preprocessing. This sets some limitations and may not
catch all problems. Also the robustness of the program may be
limited. For example, memory area guard bytes cannot be set to
catch memory access before or after the allocated reange.
Project stages:
- copy necessary files into working directory,
- perform AC++ compilation to apply aspects,
- perform C++ compilation
Example2: This AspectC++ code can only be used with already preprocessed
C++ code that contains the XMEM macro replacements. This allows
a seamless integrations of XMEM similar to the conventional
usage. Okay, this is not really an aspect oriented application
since after the preprocessing no aspects would be necessary but
it shows what could be possible if AspectC++ would provide more
information.
Project stages:
- copy necessary files into working directory,
- perform C++ preprocessing to insert XMEM macros,
- perform AC++ compilation to apply aspects,
- perform C++ compilation
This AspectC++ code presented here is still experimental. It is only
intended to be used as example for what aspect oriented programming
can be used for. Also note the fact that most of the XMEM example code
is pure C code within .cpp files - AspectC++ simply works also with this.
For all examples it may be necessary to make changes to the batch files
and projects to ensure the correct setting of paths and file names.
In the AspectC++ compiler ac++ configuration file (I named it
"pumavc8.cfg") several settings have to be done to make ac++ work
with Visual Studio 2005 (-> Visual C++ 8.0):
# configuration for Microsoft Visual Studio 2005 / MS Visual C++ 8.0
--vc
-I "C:\Programme\Microsoft Visual Studio 8\VC\include"
-A machine(i386)
-A plattform(win32)
-D __cplusplus
-D _WIN32
-D __cplusplus
-D _WCHAR_T_DEFINED
-D _M_IX86
-D _MSC_VER=1400
-D __STDC__
# work-around to overcome parser problem
-D __pragma(x)=
-D__FUNCTION__="AspectC++"
Note: The last macro -D__FUNCTION__ is just to avoid some strange errors
I could not solve for the second example, __FUNCTION__ still works correct
and display calling function/method name.
Compiling: For some reasons the example projects need two compiling runs
since the first compilation dose not finish without errors. If started
a second time the compilation finishes successful.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -