static type objects

Top  Previous  Next

What is translated > Meta information > static type objects

 

The reconstruction of the methods of TObject and TClass of the Delphi VCL in  C++ was made by means of template meta-programming. The basic idea stems from Marcin Wudraczyk:

 

http://marcin.wudarczyk.pl/education/tipstricks/metacls.htm

 

though his implementation had to be changed in some important points to fit to the design of the VCL.

 

The basic idea is, to store the meta information of classes in a static members of the classes. These members and the functions to retrieve the information are inserted into the classes by means of two macros (metaobject and metaobject_impl). That's done, when the according option is enabled.

 

Functions that are implemented by the macros are:

 

const TClass VClassType() const

 

delivers the dynamical TClass

 

const TObject* VObjectType() const

 

delivers a const object of the class

 

const TClass SClassType()

 

delivers the static type TClass

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content