⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usage_upcasting.txt

📁 LiteSQL is a C++ library that integrates C++ objects tightly to relational database and thus provide
💻 TXT
字号:
/* LiteSQL - Documentation  *  * By Tero Laitinen  *  * See LICENSE for copyright information. *//* \file usage_upcasting.txt    Manual *//** \page usage_upcasting Upcasting and Virtual MethodsIn order to support virtual methods a Persistent object must be upcasted tocorrect type before calling virtual method.upcast is a template method to which you must pass a correct base type of Persistent. upcast will return an auto_ptr which holds a pointer to an objectof correct type.upcastCopy is similar to upcast. It does not select an object of correct typebut just constructs it in memory. Note that constructed object does not haveall of its fields. This method is suitable when virtual method to be calleddoes not need any special fields.An example of upcast:\codePlayable pl = select<Playable>(db).one();pl.upcast()->play();\endcodeAn another example of upcast:\codePlayable pl = select<Playable>(db).one();auto_ptr<Playable> uc = pl.upcast();cout << "Playing " << uc->name << endl;uc->play();\endcodeAn example of upcastCopy:\codePlayable pl = select<Playable>(db).one();pl.upcastCopy()->makeLogEntry(log);\endcode*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -