Node: PObjectType, Next: Pointer, Previous: Pi, Up: Reference

### PObjectType

#### Synopsis

         type
           InternalSignedSizeType =
             Integer attribute (Size = BitSizeOf (SizeType));
           PObjectType = ^const record
             Size:        SizeType;
             NegatedSize: InternalSignedSizeType;
             Parent:      PObjectType;
             Name:        ^const String
           end;

(Note: `^record` is not valid syntax. It is just used here in the explanation because the record type has no name by itself. Because of the added method pointers (see below), there is no useful usage of the record type.)

#### Description

`PObjectType` is the type returned by `TypeOf` and required by `SetType`. In fact, the record pointed to (the VMT, “virtual method table”) also contains pointers to the virtual methods. However, these are not declared in `PObjectType` because they vary from object type to object type. The fields declared here are those that are shared by every object type and can be accessed via `TypeOf`.

`Size` contains the size of the object type, `NegatedSize` contains the size negated (for runtime checks). `Parent` contains a pointer to the parent type's VMT (or nil if the type has no parent). `Name` points to a string containing the type's name.

#### Conforming to

`PObjectType` is a GNU Pascal extension.

#### Example

#### See also

TypeOf, SetType, OOP.