Appendix A Entity and Reference Kinds |
This section lists the general categories of C/C++ reference kinds (and their inverse relations).
The following sections provide details for related groups of C/C++ reference kinds. Each grouping includes both "forward" and "backward" references (call and callby, for example).
Each group of reference kinds is presented in a table format, showing the fullname, the literal name, and from the provided code samples, the entity performing the reference (scope) and the entity being referenced. The scope and entity noted are the entities returned by calls to udbReferenceScope() and udbReferenceEntity(), respectively.
Base and Derive reference kinds may be public, protected, or private. Only public code samples are shown here. The following code sample illustrates class D which is derived from base class B. The public declaration indicates that all public functionality of class B can be accessed from class D.
class D : public B{ ... };
A base class may also be virtual. Again, only public derivation is shown here. V is the virtual base class from which D is derived.
class V { public: virtual void f(); virtual void g(); }; class D : virtual public V{ public: virtual void g(); };
Asm Call and Asm Callby indicates a reference in assembly code to a known C/C++ function. The function's name must already be declared at the point of the usage.
extern int func1(); int func() { _asm op1 _func1; _asm op1 _func2; }
Call and Callby reference kinds indicate a reference to a known C/C++ function. The function's name must already be declared at the point of the usage.
extern int func1(void); int func() { func1(); func2(); }
Inactive Call or Inactive Callby reference kinds indicate a reference to a known C/C++ function in an inactive region of code.
int func() { #if 0 func1(); #endif }
C Declare
Udb_cDeclare
func
i
C Declarein
Udb_cDeclarein
file.c
ext_func
Declare and Declarein reference kinds indicate the declaration of an entity.
extern int ext_func( char ) ; int func (void) { int i; ... }
C Define
Udb_cDefine
ifile.c
func func func
c
i
C Definein
Udb_cDefinein
func c
i file.c func func
Define and Definein reference kinds indicate the definition of an entity.
int func (char c) { int i; ... }
C Friend
Udb_cFriend
C
F
C Friendby
Udb_cFriendby
F
C
Friend and Friendby reference kinds indicate the granting of friendship to a class or member function.
class C { public: private: friend class F; };
class F { public: void f(); }; class C { public: private: friend void F::f(); };
C Include
Udb_cInclude
file.c
my_includes.h
C Includeby
Udb_cIncludeby
my_includes.h
file.c
Include and Includeby references indicate a reference to an include file.
#include "my_includes.h"
C Modify
Udb_cModify
func
i
C Modifyby
Udb_cModifyby
i
func
A Modify or Modifyby indicates a reference where a variable is modified without an explicit assignment statement. The variable is both used and set at the same reference location.
int func(int i) { i++; // modify ...}
C Set
Udb_cSet
func func
i j
C Setby
Udb_cSetby
i j
func func
A Set or Setby reference indicates any explicit assignment of a variable.
int func(int i) { int j; i = i + 1; // i is both use and set j = i; // j is set, i is use }
C Typed
Udb_cTyped
b
BYTE
C Typedby
Udb_cTypedby
BYTE
b
A Typed or Typedby reference indicates a reference to a known typedef variable.
typedef unsigned char BYTE; BYTE b;
Asm Use and Asm Useby indicates a reference in assembly code to a known C/C++ variable. The variable's name must already be declared at the point of the usage.
extern int var1; int func() { _asm op1 _var1; // var1 is known; use _asm op1 _var2; // var2 is not known; not a use }
Inactive Use and Inactive Useby indicates a reference in an inactive region of code to a known C/C++ variable. The variable's name must already be declared at the point of the usage.
extern int var1; int func() { int local_var; #if 0 local_var = var1; // inactive use of var1 #endif }
An ordinary Use or Useby indicates a reference in an active region of (non-assembler) code to a known C/C++ variable. The variable's name must already be declared at the point of the usage.
extern int var1; int func() { int local_var; local_var = var1; // use of var1 }
An Use Ptr or Useby Ptr indicates a reference to a known function pointer.
extern int funcCB (int); static void func2( int(*)() ); void func2(int(*)() cb) { (void)cb(1); return; } int main_func() { func2(funcCB); // both Use Ptr and Useby Ptr }
Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com |