dmd.dclass
Defines a class
declaration.
Specification: Classes
License
Source: dclass.d
Documentation: https://dlang.org/phobos/dmd_dclass.html
-
Declaration
struct
BaseClass
;-
Declaration
bool
fillVtbl
(ClassDeclarationcd
, FuncDeclarations*vtbl
, intnewinstance
);Fill in
vtbl
[] for base class based on member functions of classcd
.Input:
vtbl
if !=NULL, fill it innewinstance
!=0 means all entries must be filled in by members ofcd
, not members of any base classes ofcd
.Return Value
true
if any entries were filled in by members ofcd
(not exclusively by base classes)
-
-
Declaration
class
ClassDeclaration
: dmd.aggregate.AggregateDeclaration;-
Declaration
bool
stack
;true
if this is a scope class -
Declaration
int
cppDtorVtblIndex
;if this is a C++ class, this is the slot reserved for the virtual destructor
-
Declaration
Baseok
baseok
;set the progress of base classes resolving
-
Declaration
ObjcClassDeclaration
objc
;Data for a class declaration that is needed for the Objective-C integration.
-
Declaration
final bool
isBaseOf2
(ClassDeclarationcd
);Determine if 'this' is a base class of
cd
. This is used to detect circular inheritance only. -
Declaration
bool
isBaseOf
(ClassDeclarationcd
, int*poffset
);Determine if 'this' is a base class of
cd
. -
Declaration
final const bool
isBaseInfoComplete
();Determine if 'this' has complete base class information. This is used to detect forward references in covariant overloads.
-
Declaration
final ClassDeclaration
searchBase
(Identifierident
);Search base classes in depth-first, left-to-right order for a class or interface named '
ident
'. Stops at first found. Does not look for additional matches.Parameters
Identifier
ident
identifier to search for
Return Value
ClassDeclaration if found,
null
if not -
Declaration
final bool
hasMonitor
();Return Value
true
if there's a __monitor field -
Declaration
final FuncDeclaration
findFunc
(Identifierident
, TypeFunctiontf
);Find virtual function matching identifier and type. Used to build virtual function tables for interface implementations.
Parameters
Identifier
ident
function's identifier
TypeFunction
tf
function's type
Return Value
function symbol if found,
null
if notErrors: prints error message if more than one match
-
Declaration
final const bool
isCOMclass
(); -
Declaration
final bool
isAbstract
(); -
Declaration
const int
vtblOffset
();Determine if slot 0 of the vtbl[] is reserved for something else. For class objects, yes, this is where the classinfo ptr goes. For COM interfaces, no. For non-COM interfaces, yes, this is where the Interface ptr goes.
Return Value
0 vtbl[0] is first virtual function pointer 1 vtbl[0] is classinfo/interfaceinfo pointer
-
Declaration
const const(char)*
kind
(); -
Declaration
final void
addLocalClass
(ClassDeclarations*aclasses
);
-
-
Declaration
class
InterfaceDeclaration
: dmd.dclass.ClassDeclaration;-
Declaration
bool
isBaseOf
(ClassDeclarationcd
, int*poffset
);Determine if 'this' is a base class of
cd
. (Actually, if it is an interface supported bycd
)Output: *
poffset
offset to start of class OFFSET_RUNTIME must determine offset at runtimeReturn Value
false
not a basetrue
is a base -
Declaration
const const(char)*
kind
(); -
Declaration
const int
vtblOffset
();Determine if slot 0 of the vtbl[] is reserved for something else. For class objects, yes, this is where the ClassInfo ptr goes. For COM interfaces, no. For non-COM interfaces, yes, this is where the Interface ptr goes.
-