View source code
Display the source code in object.d from which this page was generated on github.
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 using local clone.

Class object.TypeInfo_Class

Runtime type information about a class. Can be retrieved from an object instance by using the typeid expression.

class TypeInfo_Class
  : TypeInfo ;

Fields

NameTypeDescription
base TypeInfo_Classbase class
depth ushortinheritance distance from Object
interfaces Interface[]interfaces this class implements
m_init byte[]class static initializer (init.length gives size in bytes of class)
name stringclass name
nameSig uint[4]unique signature for name
vtbl void*[]virtual function pointer table

Properties

NameTypeDescription
flags[get] uintGet flags for type: 1 means GC should scan for pointers, 2 means arg of this type is passed in SIMD register(s) if available
next[get] inout(TypeInfo)Get TypeInfo for 'next' type, as defined by what kind of type this is, null if none.
rtInfo[get] immutable(void)*Return info used by the garbage collector to do precise collection.
talign[get] ulongReturn alignment of type
tsize[get] ulongReturns size of the type.

Methods

NameDescription
create () Create instance of Object represented by 'this'.
find (classname) Search all modules for TypeInfo_Class corresponding to classname.
isBaseOf (child) Returns true if the class described by child derives from or is the class described by this TypeInfo_Class. Always returns false if the argument is null.
argTypes (arg1, arg2) Return internal info on arguments fitting into 8byte. See X86-64 ABI 3.2.3
compare () Compares two instances for <, ==, or >.
destroy (p) Run the destructor on the object and all its sub-objects
equals () Compares two instances for equality.
factory (classname) Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.
getHash (p) Computes a hash of the instance of a type.
initializer () Return default initializer. If the type should be initialized to all zeros, an array with a null ptr and a length equal to the type size will be returned. For static arrays, this returns the default initializer for a single element of the array, use tsize to get the correct size.
offTi () Get type information on the contents of the type; null if not available
opCmp (o) Compare with another Object obj.
opEquals (o) Test whether this is equal to o. The default implementation only compares by identity (using the is operator). Generally, overrides and overloads for opEquals should attempt to compare objects by their contents. A class will most likely want to add an overload that takes your specific type as the argument and does the content comparison. Then you can override this and forward it to your specific typed overload with a cast. Remember to check for null on the typed overload.
postblit (p) Run the postblit on the object and all its sub-objects
swap (p1, p2) Swaps two instances of the type.
toHash () Compute hash function for Object.
toString () Convert Object to a human readable string.

Authors

Walter Bright, Sean Kelly

License

Boost License 1.0.