object
Part of the D programming language runtime library. Forms the symbols available to all D programs. Includes Object, which is the root of the class object hierarchy.Authors:
Walter Bright, Bartosz Milewski
This module is implicitly imported.
- An unsigned integral type large enough to span the memory space. Use for
array indices and pointer offsets for maximal portability to
architectures that have different memory address ranges. This is
analogous to C's size_t.
- A signed integral type large enough to span the memory space. Use for
pointer differences and for size_t differences for maximal portability to
architectures that have different memory address ranges. This is
analogous to C's ptrdiff_t.
- Standard boolean type.
- All D class objects inherit from Object.
- Convert Object to a human readable string.
- Compute hash function for Object.
- Compare with another Object obj.
Returns:
this < obj < 0 this == obj 0 this > obj > 0
- Returns !=0 if this object does have the same contents as obj.
- Create instance of class specified by classname.
The class must either have no constructors or have
a default constructor.
Returns:
null if failed
- Information about an interface.
When an object is accessed via an interface, an Interface* appears as the
first entry in its vtbl.
- Runtime type information about a class. Can be retrieved for any class type
or instance by using the .classinfo property.
A pointer to this appears as the first entry in the class's vtbl[].
- class static initializer
(init.length gives size in bytes of class)
- class name
- virtual function pointer table
- interfaces this class implements
- base class
- Search all modules for ClassInfo corresponding to classname.
Returns:
null if not found
- Create instance of Object represented by 'this'.
Returns:
the object created, or null if the Object does does not have a default constructor
- Search for all members with the name 'name'.
If name[] is null, return all members.
- Array of pairs giving the offset and type information for each
member in an aggregate.
- Offset of member from start of object
- TypeInfo for this member
- Runtime type information about a type.
Can be retrieved for any type using a
TypeidExpression.
- Returns a hash of the instance of a type.
- Compares two instances for equality.
- Compares two instances for <, ==, or >.
- Returns size of the type.
- Swaps two instances of the type.
- Get TypeInfo for 'next' type, as defined by what kind of type this is,
null if none.
- Return default initializer, null if default initialize to 0
- Get flags for type: 1 means GC should scan for pointers
- Get type information on the contents of the type; null if not available
- Run the destructor on the object and all its sub-objects
- Run the postblit on the object and all its sub-objects
- All recoverable exceptions should be derived from class Exception.
- this(string msg);
- Constructor; msg is a descriptive message for the exception.
- All irrecoverable exceptions should be derived from class Error.
- this(string msg);
- Constructor; msg is a descriptive message for the exception.