Top  Previous  Next

What is translated > Meta information > TObject/TD2CObject


The class TObject, which is defined in the files d2c_systobj.h and d2c_systobj.cpp can be used with other compilers than C++ Builder as basis for a substitute of TObject of the Borland VCL. The class TD2CObject can be used with C++ Builder to enrich the capabilities of TObject, which already exists there. Analogously TMetaClass and TD2CMetaClass are used with other compilers or with C++ Builder.


TObject/TD2CObject and TMetaClass/TD2CMetaClass mainly consist of the same functions:


The methods of TMetaClass/TD2CMetaClass correspond to the static methods of TObject/TD2CObject. They have the same functionality but differ in parameters. Whereas the TObject/TD2CObject methods take a TClass/TD2CClass (TD2CMetaClass*/TMetaClass*) as the first parameter, this parameter is implicit in the TMetaClass/TD2CMetaClass methods.


These methods are known from Delphi and their description can be found in the Delphi help files. There is a difference, though: name and type information result from std::type_info in C++ and their values are different from the values in Delphi.


  virtual const char* __fastcall ClassName() const;

  virtual bool __fastcall ClassNameIs(const char* S) const;

  virtual TClass __fastcall ClassParent() const;

  virtual void * __fastcall ClassInfo() const;

  virtual bool __fastcall InheritsFrom(TClass aClass) const;

  virtual TObject* __fastcall NewInstance() const; 

  virtual TObject* __fastcall Create() const; 




The implementation was made by template meta programming.



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content