ClassDeclaration

extern (C++)
class ClassDeclaration : AggregateDeclaration {
extern (C++) __gshared
ClassDeclaration object;
extern (C++) __gshared
ClassDeclaration throwable;
extern (C++) __gshared
ClassDeclaration exception;
extern (C++) __gshared
ClassDeclaration errorException;
extern (C++) __gshared
ClassDeclaration cpp_type_info_ptr;
ClassDeclaration baseClass;
FuncDeclaration staticCtor;
FuncDeclaration staticDtor;
Dsymbols vtbl;
Dsymbols vtblFinal;
BaseClasses* baseclasses;
BaseClass*[] interfaces;
BaseClasses* vtblInterfaces;
TypeInfoClassDeclaration vclassinfo;
bool com;
ThreeState isabstract;
Symbol* cpp_type_info_ptr_sym;
enum OFFSET_RUNTIME;
enum OFFSET_FWDREF;
Dsymbol vtblsym;
}

Members

Functions

addObjcSymbols
void addObjcSymbols(ClassDeclarations* classes, ClassDeclarations* categories)
findFunc
FuncDeclaration findFunc(Identifier ident, TypeFunction tf)

Find virtual function matching identifier and type. Used to build virtual function tables for interface implementations.

hasMonitor
bool hasMonitor()
isAbstract
bool isAbstract()
isBaseInfoComplete
bool isBaseInfoComplete()

Determine if 'this' has complete base class information. This is used to detect forward references in covariant overloads.

isBaseOf
bool isBaseOf(ClassDeclaration cd, int* poffset)

Determine if 'this' is a base class of cd.

isBaseOf2
bool isBaseOf2(ClassDeclaration cd)

Determine if 'this' is a base class of cd. This is used to detect circular inheritance only.

isCOMclass
bool isCOMclass()
kind
const(char)* kind()
searchBase
ClassDeclaration searchBase(Identifier ident)

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.

vtblOffset
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.

Variables

baseok
Baseok baseok;

set the progress of base classes resolving

cppDtorVtblIndex
int cppDtorVtblIndex;

if this is a C++ class, this is the slot reserved for the virtual destructor

objc
ObjcClassDeclaration objc;

Data for a class declaration that is needed for the Objective-C integration.

stack
bool stack;

true if this is a scope class

Inherited Members

From AggregateDeclaration

type
Type type;
storage_class
StorageClass storage_class;
structsize
uint structsize;

size of struct

alignsize
uint alignsize;

size of struct for alignment purposes

fields
VarDeclarations fields;

VarDeclaration fields

deferred
Dsymbol deferred;

any deferred semantic2() or semantic3() symbol

classKind
ClassKind classKind;

specifies whether this is a D, C++, Objective-C or anonymous struct/class/interface

cppmangle
CPPMANGLE cppmangle;

Specify whether to mangle the aggregate as a class or a struct This information is used by the MSVC mangler Only valid for class and struct. TODO: Merge with ClassKind ?

pMangleOverride
MangleOverride* pMangleOverride;

overridden symbol with pragma(mangle, "...") if not null

enclosing
Dsymbol enclosing;

!=null if is nested pointing to the dsymbol that directly enclosing it. 1. The function that enclosing it (nested struct and class) 2. The class that enclosing it (nested class only) 3. If enclosing aggregate is template, its enclosing dsymbol.

vthis
VarDeclaration vthis;

'this' parameter if this aggregate is nested

vthis2
VarDeclaration vthis2;

'this' parameter if this aggregate is a template and is nested

invs
FuncDeclarations invs;

Array of invariants

inv
FuncDeclaration inv;

Merged invariant calling all members of invs

ctor
Dsymbol ctor;

CtorDeclaration or TemplateDeclaration

defaultCtor
CtorDeclaration defaultCtor;

default constructor - should have no arguments, because it would be stored in TypeInfo_Class.defaultConstructor

aliasthis
AliasThis aliasthis;

forward unresolved lookups to aliasthis

userDtors
DtorDeclarations userDtors;

user-defined destructors (~this()) - mixins can yield multiple ones

aggrDtor
DtorDeclaration aggrDtor;

aggregate destructor calling userDtors and fieldDtor (and base class aggregate dtor for C++ classes)

dtor
DtorDeclaration dtor;

the aggregate destructor exposed as __xdtor alias

tidtor
DtorDeclaration tidtor;

(same as aggrDtor, except for C++ classes with virtual dtor on Windows) +//// aggregate destructor used in TypeInfo (must have extern(D) ABI

fieldDtor
DtorDeclaration fieldDtor;

function destructing (non-inherited) fields

getRTInfo
Expression getRTInfo;

pointer to GC info generated by object.RTInfo(this)

visibility
Visibility visibility;
noDefaultCtor
bool noDefaultCtor;

no default construction

disableNew
bool disableNew;

disallow allocations using new

sizeok
Sizeok sizeok;

set when structsize contains valid data

newScope
Scope* newScope(Scope* sc)

Create a new scope from sc. semantic, semantic2 and semantic3 will use this for aggregate members.

nonHiddenFields
size_t nonHiddenFields()
determineSize
bool determineSize(Loc loc)

Collect all instance fields, then determine instance size.

checkOverlappedFields
bool checkOverlappedFields()

Calculate fieldi.overlapped and overlapUnsafe, and check that all of explicit field initializers have unique memory space on instance.

fill
bool fill(Loc loc, Expressions elements, bool ctorinit)

Fill out remainder of elements[] with default initializers for fields[].

alignmember
void alignmember(structalign_t alignment, uint memalignsize, uint* poffset)

Do byte or word alignment as necessary. Align sizes of 0, as we may not know array sizes yet.

placeField
uint placeField(uint* nextoffset, uint memsize, uint memalignsize, structalign_t alignment, uint* paggsize, uint* paggalignsize, bool isunion)

Place a field (mem) into an aggregate (agg), which can be a struct, union or class

setDeprecated
void setDeprecated()

Flag this aggregate as deprecated

isNested
bool isNested()

Returns true if there's an extra member which is the 'this' pointer to the enclosing context (enclosing aggregate or function)

searchCtor
Dsymbol searchCtor()

Look for constructor declaration.

sinit
void* sinit;

initializer symbol

Meta