Class TObject

Implements Delphi TObject semantics where you have to call .Free() to destroy the object. Has AfterConstruction and BeforeDestruction methods, which can be overridden.

Constructors

Methods

  • Responds after the last constructor has executed.

    AfterConstruction is called automatically after the object's last constructor has executed. Do not call it explicitly in your applications.

    The AfterConstruction method implemented in TObject does nothing. Override this method when creating a class that performs an action after the object is created.

    Returns void

  • Responds before the first destructor executes.

    BeforeDestruction is called automatically before the object's first destructor executes. Do not call it explicitly in your applications.

    The BeforeDestruction method implemented in TObject does nothing. Override this method when creating a class that performs an action before the object is destroyed.

    Returns void

  • performs cleanup tasks and destroys the object

    Returns void

  • Calls destroy to perform any cleanup tasks. Call Free() to destroy the object, so as to retain Delphi-style AfterConstruction and BeforeDestruction semantics.

    Returns void

  • Destroys the object, maintaining Delphi-style AfterConstruction and BeforeDestruction semantics.

    Returns void

  • Creates a new instance of the class. To create a new constructor, declare the constructor(args) method and call the super constructor. Then, to instantiate the class, call YourClass.Create(args) instead of new YourClass(args), so as to retain Delphi-style AfterConstruction and BeforeDestruction semantics.

    Type Parameters

    Parameters

    • this: (new (...args: any[]) => T)
        • new (...args): T
        • Parameters

          • Rest...args: any[]

          Returns T

    • Rest...args: any[]

    Returns T