Appendix A Entity and Reference Kinds

## C Entity Kinds

This section lists the general categories of C entity kinds and the specific kind literal names associated with them.

### C Class Kinds

Use "c class" to match all C Class entity kinds.

KIND FULlName | Literal Name
--- | ---
C Abstract Class Type | Udb_cAbstractClassType
C Class Type | Udb_cClassType
C Private Member Class Type | Udb_cPrivateMemberClassType
C Protected Member Class Type | Udb_cProtectedMemberClassType
C Public Member Class Type | Udb_cPublicMemberClassType
C Unknown Class Type | Udb_cUnknownClassType
C Unnamed Class Type | Udb_cUnnamedClassType
C Unnamed Private Member Class Type | Udb_cUnnamedPrivateMemberClassType
C Unnamed Protected Member Class Type | Udb_cUnnamedProtectedMemberClassType
C Unnamed Public Member Class Type | Udb_cUnnamedPublicMemberClassType
C Unresolved Class Type | Udb_cUnresolvedClassType

An ordinary class is a class that is not a member in another class, and is not unnamed or unresolved.

     class A {                   // Udb_cClassType
      ...
    };

An abstract class is a class with at least one pure virtual member function.

     class c {                     // Udb_cAbstractClassType
       int virtual func1()=0;
     };

A class may itself be a member of another class. In this case it may be private, protected, or public.

     class c {
       private: class c_private {}; //Udb_cPrivateMemberClassType
     };

A member class may be unnamed.

     class A {
       class {                      // Udb_cUnnamedClassType
         int a;
         } b;
     };

An unresolved class is a class that is known to exist but who's definition is unknown. An unknown class is an unresolved class, but is also lacking any formal declaration.

     class c_unresolved;

     class c_unresolved var_1;      // Udb_cUnresolvedClass
     class c_unknown    var_2;      // Udb_cUnknownClass

See Also: Enum Kinds, Function Kinds, Object Kinds, Struct Kinds, Typedef Kinds, and Union Kinds for entity kinds of Class Members.

### C Enum Kinds

Use "c enum" to match all C Enum Type kinds

KIND FULlName | Literal Name
--- | ---
C Enum Type | Udb_cEnumType
C Private Member Enum Type | Udb_cPrivateMemberEnumType
C Protected Member Enum Type | Udb_cProtectedMemberEnumTyp
C Public Member Enum Type | Udb_cPublicMemberEnumType
C Unknown Enum Type | Udb_cUnknownEnumType
C Unnamed Enum Type | Udb_cUnnamedEnumType
C Unnamed Private Member Enum Type | Udb_cUnnamedPrivateMemberEnumType
C Unnamed Protected Member Enum Type | Udb_cUnnamedProtectedMemberEnumType
C Unnamed Public Member Enum Type | Udb_cUnnamedPublicMemberEnumType
C Unresolved Enum Type | Udb_cUnresolvedEnumType

An ordinary enum type is an enumerated data type which is not a member of a class.

     enum etype1 { val1, val2 };    // Udb_cEnumType

An enum type may be a member of a class. In this case it may be private, protected, or public.

     class c {
       protected: enum etype1 {val1, val2};
                                  //Udb_cProtectedMemberEnumType
     };

A member or non-member enum type may be unnamed.

     enum { val1, val2 } var_1;    // Udb_cUnnamedEnumType

An unresolved enum type is an enumerator type that is that is referenced but for which no definition has been found. This can happen when an include file isn't found. An unknown enum type had neither a definition nor a declaration.

     enum etype1;

     etype1    var_1;      // Udb_cUnresolvedEnumType
     unk_type  var_2;      // Udb_cUnknownEnumType

See Also: Enumerator Kinds for the enumerator values of enumerated data types.

### C Enumerator Kinds

Use "c enumerator" to match all C Enumerator kinds

KIND FULlName | Literal Name
--- | ---
C Enumerator | Udb_cEnumerator
C Unresolved Enumerator | Udb_cUnresolvedEnumerator

An enumerator is the identifier assigned a value in an enum type.

     enum etype {
       e_val_1, e_val_2, e_val_3     // Udb_cEnumerator
     };

An unresolved enumerator is an enumerator identifier that belongs to an enum type that is declared in an included file which is not part of the project.

     include enumTypes.h      // Udb_cUnknownHeaderFile
     ...
     etype1  var_1;
     var_1 = e_val_2;         // Udb_cUnresolvedEnumerator

See Also: Enum Kinds for enumerator type kinds.

### C File Kinds

Use "c file" to match all C File kinds

KIND FULlName | Literal Name
--- | ---
C Code File | Udb_cCodeFile
C Header File | Udb_cHeaderFile
C Unknown Header File | Udb_cUnknownFile
C Unresolved Header File | Udb_cUnresolvedHeaderFile

Code files are project files which are not included by any other files (typically *.c, *.cpp). Header files are project files which are included by at least one other file (typcially *.h, *.hpp).

An unknown header file is a header file that has been included by another file but cannot be located.

     #include "unk_file.h"            // Udb_cUnknownHeaderFile

An unresolved header file is an intermediate entity kind used by the parser and should never be visible at the API level. Any unresolved header file will either become a known header file (if the file can be located and parsed) or an unknown header file (if the file cannot be located) before the completion of the analysis run.

### C Function Kinds

Use "c function" to match all C Function kinds

KIND FULlName | Literal Name
--- | ---
C Function | Udb_cFunction
C Function Static | Udb_cFunctionStatic
C Private Member Const Function | Udb_cPrivateMemberConstFunction
C Private Member Const Function Pure | Udb_cPrivateMemberConstFunctionPure
C Private Member Function | Udb_cPrivateMemberFunction
C Private Member Function Pure | Udb_cPrivateMemberFunctionPure
C Protected Member Const Function | Udb_cProtectedMemberConstFunction
C Protected Member Const Function Pure | Udb_cProtectedMemberConstFunctionPure
C Protected Member Function | Udb_cProtectedMemberFunction
C Protected Member Function Pure | Udb_cProtectedMemberFunctionPure
C Public Member Const Function | Udb_cPublicMemberConstFunction
C Public Member Const Function Pure | Udb_cPublicMemberConstFunctionPure
C Public Member Function | Udb_cPublicMemberFunction
C Public Member Function Pure | Udb_cPublicMemberFunctionPure
C Unknown Function | Udb_cUnknownFunction
C Unknown Member Function | Udb_cUnknownMemberFunction
C Unresolved Function | Udb_cUnresolvedFunction
C Unresolved Private Member Const Function | Udb_cUnresolvedPrivateMemberConstFunction
C Unresolved Private Member Const Function Pure | Udb_cUnresolvedPrivateMemberConstFunctionPure
C Unresolved Private Member Function | Udb_cUnresolvedPrivateMemberFunction
C Unresolved Private Member Function Pure | Udb_cUnresolvedPrivateMemberFunctionPure
C Unresolved Protected Member Const Function | Udb_cUnresolvedProtectedMemberConstFunction
C Unresolved Protected Member Const Function Pure | Udb_cUnresolvedProtectedMemberConstFunctionPure
C Unresolved Protected Member Function | Udb_cUnresolvedProtectedMemberFunction
C Unresolved Protected Member Function Pure | Udb_cUnresolvedProtectedMemberFunctionPure
C Unresolved Public Def Member Const Function | Udb_cUnresolvedPublicDefMemberConstFunction
C Unresolved Public Member Const Function | Udb_cUnresolvedPublicMemberConstFunction
C Unresolved Public Member Const Function Pure | Udb_cUnresolvedPublicMemberConstFunctionPure
C Unresolved Public Member Function | Udb_cUnresolvedPublicMemberFunction
C Unresolved Public Member Function Pure | Udb_cUnresolvedPublicMemberFunctionPure

A function may be an ordinary function that is not a static function and not a member of a class.

     int func1(void);                // Udb_cFunction

A non-member function that is declared static can only be referenced from within the same file that contains the function.

     static int func1 (void) { }     // Udb_cFunctionStatic

A function may be a member of a class. In this case the member function may be private, protected, or public.

     class c {
       public:
         void func1 (void) {...};    // Udb_cPublicMemberFunction
     };

A member function declared as static exists once for the whole class, not in each class instance.

     class c {
       private:
         static void func1 () {...};
                             //Udb_cPrivateMemberFunctionStatic
     };

A member function may also be declared const, which indicates that it will not alter the state of the object on which it is invoked.

     class c {
         protected:
           int func1 () const; //Udb_cProtectedMemberConstFunction
     };

A pure virtual member function is a virtual member function that does not have an implementation. A pure virtual function cannot be called. It must be overriden in a derived class in order to be used.

     class c {
      public:
        virtual int foobar() = 0; //Udb_cPublicMemberFunctionPure
     };

An unresolved function or unresolved member function is a function that is known to exist but who's definition is unknown. Typically this occurs when the function is defined in a file that is not part of the project. An unknown function is an unresolved function that is also lacking any formal declaration.

     void func1(int);

     int func() {
        func1(1);        // Udb_cUnresolvedFunction
        func2(1);        // Udb_cUnknownFunction
     }

### C Macro Kinds

Use "c macro" to match all C Macro kinds

KIND FULlName | Literal Name
--- | ---
C Inactive Macro | Udb_cInactiveMacro
C Macro | Udb_cMacro
C Unknown Macro | Udb_cUnknownMacro
C Unresolved Macro | Udb_cUnresolvedMacro

A macro which is defined in and used in an active region of code is Udb_cMacro. For example:

     #define MACRO_ACTIVE

An inactive macro appears in an inactive region of code.

     #if 0
     #ifdef MACRO_INACTIVE
     #endif
     #endif

An unresolved macro is one that is known to exist but who's definition is not available in the current scope. An unknown macro is a macro whose definition is not known. Typically this occurs when the macro is defined in an included file that is not part of the project.

     #include "my_macros.h"     // Udb_cUnknownHeaderFile
     #ifdef  MY_MACRO           // Udb_cUnknownMacro
     ...
     #endif

### C Object Kinds

Use "c object" to match all C Object kinds

KIND FULlName | Literal Name
--- | ---
C Object Global | Udb_cObjectGlobal
C Object Global Static | Udb_cObjectGlobalStatic
C Object Local | Udb_cObjectLocal
C Private Member Object | Udb_cPrivateMemberObject
C Protected Member Object | Udb_cProtectedMemberObject
C Public Member Object | Udb_cPublicMemberObject
C Unknown Member Object | Udb_cUnknownMemberObject
C Unknown Object | Udb_cUnknownObject
C Unresolved Object | Udb_cUnresolvedObject
C Unresolved Private Member Object | Udb_cUnresolvedPrivateMemberObject
C Unresolved Protected Member Object | Udb_cUnresolvedProtectedMemberObject

A global object is a variable which is not a member of a class, is not declared within a function, and is not declared as static.

     int global_var;          // Udb_cObjectGlobal

A global static object is a variable which is not a member of a class and is not declared within a function, but is declared static, and is therefore only accessible from the file in which it is defined.

     static int static_global_var;  // Udb_cObjectGlobalStatic

A local object is a variable which is not a member of a class and is defined within a (non-member) function.

     void func1() {
       int local_var_1;          // Udb_cObjectLocal
       static int local_var_2;   // Udb_cObjectLocal
     }

An object may be a member of a class. In this case the object may be private, protected, or public.

     class A {
       public:
         int obj1;    // Udb_cPublicMemberObject
     };

An unresolved object is a variable which is known to exist, but who's definition is unknown. This typically occurs when a header file is not part of the project. An unknown object is a variable with no known definition or declaration.

     extern var_1;

     int func() {
        var_2 = var_1;        // var_1 is Udb_cUnresolvedObject
                               // var_2 is Udb_cUnknownObject
     }

### C Parameter Kinds

Use "c parameter" to match all C Parameter kinds

KIND FULlName | Literal Name
--- | ---
C Parameter | Udb_cParameter

A parameter is a formal parameter to any function or member function.

     extern int func_ext(int param_ext); //not a parameter entity
     void func (int param_1) {};         // Udb_cParameter

### C Struct Kinds

Use "c struct" to match all C Struct kinds

KIND FULlName | Literal Name
--- | ---
C Abstract Struct Type | Udb_cAbstractStructType
C Private Member Struct Type | Udb_cPrivateMemberStructType
C Protected Member Struct Type | Udb_cProtectedMemberStructType
C Public Member Struct Type | Udb_cPublicMemberStructType
C Struct Type | Udb_cStructType
C Unknown Struct Type | Udb_cUnknownStructType
C Unnamed Private Member Struct Type | Udb_cUnnamedPrivateMemberStructType
C Unnamed Protected Member Struct Type | Udb_cUnnamedProtectedMemberStructType
C Unnamed Public Member Struct Type | Udb_cUnnamedPublicMemberStructType
C Unnamed Struct Type | Udb_cUnnamedStructType
C Unresolved Struct Type | Udb_cUnresolvedStructType

A struct type may be an ordinary struct, that is, not a member of a class.

     struct mystruct {         // Udb_cStructType
      int field1;
      int field2;
      };

A struct may be unnamed. The following example shows an array of 10 elements containing a structure consisting of two int members

     struct {                  //Udb_cUnnamedStructType
       int field1;
       int field2;
    }myarray[10];

A struct may be a member of a class. In this case the struct may be private, protected, or public.

     class A {
       public:
         struct mystruct{        // Udb_cPublicMemberStructType
            int field1;
            int field2;
         };
     }

A struct may be an abstract struct, which is a struct with at least one pure virtual member function.

     struct struct_abstract {    // Udb_cAbstractStructType
      int virtual mem1() = 0;
    };

An unresolved struct is a struct that is known to exist but who's definition is unknown. An unknown struct is an unresolved struct, but is also lacking any formal declaration.

     extern struct a_struct;     // Udb_cUnresolvedStructType
     typedef struct b_struct T;  // Udb_cUnknownStruct

### C Typedef Kinds

Use "c typedef" to match all C Typedef kinds.

KIND FULlName | Literal Name
--- | ---
C Private Member Typedef Type | Udb_cPrivateMemberTypedefType
C Protected Member Typedef Type | Udb_cProtectedMemberTypedefType
C Public Member Typedef Type | Udb_cPublicMemberTypedefType
C Typedef Type | Udb_cTypedefType
C Unknown Type | Udb_cUnknownType
C Unresolved Typedef Type | Udb_cUnresolvedTypedefType

A typedef is used to assign an alternate name to a data type.

     typedef   int   COUNTER;    // Udb_cTypedefType

A typedef may be a member of a class. In this case the typedef may be private, protected, or public.

     class A {
       public:
         typedef int COUNTER;   // Udb_cPublicMemberTypedefType
     };

An unresolved typedef is a typedef which is known to exist, but who's definition is unknown. This typically occurs when a header file is not part of the project. An unknown type is some type (typedef, class, etc) whose definition and declaration is not found.

     #include "my_type2.h"  // Udb_cUnresolvedHeaderFile;
     mytype2 var;  // Udb_cUnresolvedTypedefType;
                   // mytype2 is defined in unresolved header file

     int func (mytype1 tvar) {   //mytype1 is Udb_cUnknownType
     ...
     }

### C Union Kinds

Use "c union" to match all C Union kinds.

KIND FULlName | Literal Name
--- | ---
C Private Member Union Type | Udb_cPrivateMemberUnionType
C Protected Member Union Type | Udb_cProtectedMemberUnionType
C Public Member Union Type | Udb_cPublicMemberUnionType
C Union Type | Udb_cUnionType
C Unknown Union Type | Udb_cUnknownUnionType
C Unnamed Private Member Union Type | Udb_cUnnamedPrivateMemberUnionType
C Unnamed Protected Member Union Type | Udb_cUnnamedProtectedMemberUnionType
C Unnamed Public Member Union Type | Udb_cUnnamedPublicMemberUnionType
C Unnamed Union Type | Udb_cUnnamedUnionType
C Unresolved Union Type | Udb_cUnresolvedUnionType

A union allows storage of different types of data into the same storage area.

     union anyNumber{           // Udb_cUnionType
       int i;
       float f;
    };

A union may be a member of a class. In this case the union may be private, protected, or public.

     class A {
       public:
         union anyNumber{     // Udb_cPublicMemberUnionType
         int i;
         float f;
        };
    }

A union or member union may be unnamed.

     union {                  // Udb_cUnnamedUnionType
       int i;
       float f;
    } mydata;

An unresolved union is a union which is known to exist, but who's definition is unknown. This typically occurs when a header file is not part of the project. An unknown union is a union whose definition and declaration is not found.

     #include "my_unions.h" // Udb_cUnresolvedHeaderFile;
     union my_union data;  // Udb_cUnresolvedUnionType
                  // my_union is defined in unresolved header file

     union unknown_union more_data;  //unknown_union is not
                                 // defined and is Udb_cUnknownType

Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com