Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

dmd.aggregate

Defines aDsymbol representing an aggregate, which is astruct,union orclass.

SpecificationStructs, Unions,Class.

Authors:
Walter Bright
License:
Boost License 1.0

Sourceaggregate.d

Documentationhttps://dlang.org/phobos/dmd_aggregate.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/aggregate.d

enumClassKind: ubyte;
The ClassKind enum is used in AggregateDeclaration AST nodes to specify the linkage type of the struct/class/interface or if it is an anonymous class. If the class is anonymous it is also considered to be a D class.
d
the aggregate is a d(efault) class
cpp
the aggregate is a C++ struct/class/interface
objc
the aggregate is an Objective-C class/interface
c
the aggregate is a C struct
@safe const(char)*ClassKindToChars(ClassKindc);
Give a nice string for a class kind for error messages
Parameters:
ClassKindcclass kind
Returns:
0-terminated string forc
structMangleOverride;
If an aggregate has a pargma(mangle, ...) this holds the information to mangle.
abstract classAggregateDeclaration:dmd.dsymbol.ScopeDsymbol;
Abstract aggregate as a common ancestor for Class- and StructDeclaration.
Typetype;
STCstorage_class;
uintstructsize;
size of struct
uintalignsize;
size of struct for alignment purposes
VarDeclarationsfields;
VarDeclaration fields including flattened AnonDeclaration members
Dsymboldeferred;
any deferred semantic2() or semantic3() symbol
ClassKindclassKind;
specifies whether this is a D, C++, Objective-C or anonymous struct/class/interface
CPPMANGLEcppmangle;
Specify whether to mangle the aggregate as aclass or astructThis information is used by the MSVC manglerOnly valid for class and struct. TODO: Merge with ClassKind ?
MangleOverride*pMangleOverride;
overridden symbol with pragma(mangle, "...") if not null
Dsymbolenclosing;
!=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.
See AggregateDeclaraton::makeNested for the details.
VarDeclarationvthis;
'this' parameter if this aggregate is nested
VarDeclarationvthis2;
'this' parameter if this aggregate is a template and is nested
FuncDeclarationsinvs;
Array of invariants
FuncDeclarationinv;
Merged invariant calling all members of invs
Dsymbolctor;
CtorDeclaration or TemplateDeclaration
CtorDeclarationdefaultCtor;
default constructor - should have no arguments, becauseit would be stored in TypeInfo_Class.defaultConstructor
AliasThisaliasthis;
forward unresolved lookups to aliasthis
DtorDeclarationsuserDtors;
user-defined destructors (~this()) - mixins can yield multiple ones
DtorDeclarationaggrDtor;
aggregate destructor calling userDtors and fieldDtor (and base class aggregate dtor for C++ classes)
DtorDeclarationdtor;
the aggregate destructor exposed as__xdtor alias
DtorDeclarationtidtor;
(same as aggrDtor, except for C++ classes with virtual dtor on Windows)
aggregate destructor used in TypeInfo (must have extern(D) ABI)
DtorDeclarationfieldDtor;
function destructing (non-inherited) fields
ExpressiongetRTInfo;
pointer to GC info generated by object.RTInfo(this)
Scope*rtInfoScope;
scope to be used when evaluating getRTInfo
Visibilityvisibility;
boolnoDefaultCtor;
no default construction
booldisableNew;
disallow allocations usingnew
Sizeoksizeok;
set when structsize contains valid data
Scope*newScope(Scope*sc);
Create a new scope from sc. semantic, semantic2 and semantic3 will use this for aggregate members.
final size_tnonHiddenFields();
Returns:
The total number of fields minus the number of hidden fields.
final voidsetDeprecated();
Flag this aggregate as deprecated
final boolisNested() const;
Returns true if there's an extra member which is the 'this' pointer to the enclosing context (enclosing aggregate or function)
void*sinit;
initializer symbol
pure nothrow @safe uintalignmember(structalign_talignment, uintmemalignsize, uintoffset);
Do byte or word alignment as necessary. Align sizes of 0, as we may not know array sizes yet.
Parameters:
structalign_talignmentstruct alignment that is in effect
uintmemalignsizenatural alignment of field
uintoffsetoffset to be aligned
Returns:
aligned offset
nothrow @trusted uintplaceField(Locloc, ref uintnextoffset, uintmemsize, uintmemalignsize, structalign_talignment, ref uintaggsize, ref uintaggalignsize, boolisunion);
Place a field (mem) into an aggregate (agg), which can be a struct, union or class
Parameters:
Loclocsource location for error messages
uintnextoffsetlocation just past the end of the previous field in the aggregate. Updated to be just past the end of this field to be placed, i.e. the future nextoffset
uintmemsizesize of field
uintmemalignsizenatural alignment of field
structalign_talignmentalignment in effect for this field
uintaggsizesize of aggregate (updated)
uintaggalignsizealignment of aggregate (updated)
boolisunionthe aggregate is a union
Returns:
aligned offset to place field at
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 00:04:49 2026

[8]ページ先頭

©2009-2026 Movatter.jp