rtti

    1热度

    1回答

    Howdey, 我使用TVirtualInterface实现一些接口的基本接口。这些interfaes代表可以在数据库中找到的Keys。我使用定制的代码生成器生成接口定义。例如: // Base code IKey = interface function KeyFields : string; function KeyValues : Variant; func

    1热度

    1回答

    我有这样一个项目: |--CMakeLists.txt(1) |--File1.cpp -W -W-all |--Folder1 |--CMakeLists.txt(2) |--File2.cpp -W -W-all -fno-rtti 正如你可以在上面看到,File2.cpp需要与-fno-rtti编译,而其他文件应与rtti编译。这是因为我在我的项目中使用了clan

    0热度

    1回答

    我有一个类 type myClass = class private FId: Integer; public function GetId: Integer; property Id: Integer read FId; end; 现在,我要交换Id属性getter在运行时使用的GetId方法而不是FId领域。我可以使用R

    2热度

    1回答

    我正在Delphi-Tokyo的Delphi-Tokyo学习RTTI来创建一个ORM,但我在访问同时也是对象的属性时遇到了问题。在下面的代码中,我如何执行Prop的演员代码为id?在TRttiProperty实例 unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.

    25热度

    3回答

    #include <memory> struct foo { }; int main() { std::make_shared<foo>(); } 双方g++7和clang++5与-fno-exceptions -Ofast对于上面的代码所产生的asssembly: 包含对operator new单个呼叫如果是-fno-rtti不传递。 包含两个单独的呼叫到operator new如果-f

    -1热度

    1回答

    所以,我有一个类使用WM_COPYDATA来允许应用程序进行通信。 type TMyRec = record Name: string[255]; Age: integer; Birthday: TDateTime; end; function TAppCommunication.SendRecord(const ARecordToSend:

    1热度

    1回答

    我有一个嵌入式TFrame和一些具有关联属性的组件(包括父窗体和框架)。余可使用访问父形式部件属性: for field in ctx.GetType(frm.ClassInfo).GetFields do for attr in field.GetAttributes do... 我试图通过在主循环使用以下嵌套访问该帧中的属性: for subField in ctx.GetTyp

    1热度

    1回答

    我使用下面的代码来设置属性使用RTTI与德尔福10.2东京在运行时创建的组件,一切正常,因为该示例的属性是TypeLine,因为我可以直接访问它。 Componente_cc是可以与任何类实例化一个变量,无论是TLabel,TButton,TEdit ......或任何其他。在这种情况下在下面,我将其实例化作为一个TLine. Var Componente_cc: TControl;

    16热度

    2回答

    我正在尝试创建std::unordered_map,其中值是std::type_index。下面的代码片段工作: std::unordered_map<std::type_index, int> workingMap; workingMap[typeid(int)] = 1; workingMap[typeid(char)] = 2; 但是这一次不运行,并抛出一个错误: std::unor

    2热度

    1回答

    我可以使用说typeid或dynamic_cast在派生的基类实例之间切换。例如: struct B { virtual ~B() {} }; struct D1 : B {}; struct D2 : B {}; void doit(B &b) { if (dynamic_cast<D1 *>(&b)) foo1(); else if (dynamic_cast<