Every
class inherits from TObject methods called ClassType and ClassParent
that return, respectively, a reference to the class of an object and of an
object’s immediate ancestor. Both methods return a value of type TClass
(where TClass = class of TObject), which can be cast to a more specific type.
Every class also inherits a method called InheritsFrom that tests
whether the object where it is called descends from a specified class. These
methods are used by the is and as operators, and it is seldom
necessary to call them directly.
每个类都继承了TObject中的Classtype和ClassParent方法,分别是对象所属的类、对象的直接祖先所属的类的引用。两个方法都返回TClass(TClass = class of TObject)类型,它可以被转换成为更精确的类型。每个类还继承了一个叫做InheritsFrom的方法,该方法用于测试对象是否起源于指定的类。这些方法都用于is运算符和as运算符,并且很少有必要直接调用这些方法。