C++对象的肥API绑定到脚本语言
Fat API bindings of C++ objects into scripting languages
AI总结:
本文探讨通过REST服务和Node.jsAPI模块,利用Classdesc系统实现C++对象到JavaScript/TypeScript环境的反射。
摘要:
肥API暴露了C++对象的几乎所有公共属性和方法到消费环境,如脚本语言或网络客户端。这与传统的、瘦API形成对比,其中API在前期定义,C++对象提供实现,大部分是C++层的私有部分。显然,需要反射来将C++对象暴露给这样的消费层--本文探讨使用Classdesc系统通过REST服务和Node.jsAPI模块实现C++对象到JavaScript/TypeScript环境的反射。
英文摘要:
A fat API exposes nearly all of a C++ object's public attributes and methods to a consuming environment, such as a scripting language, or web client. This can be contrasted with a conventional, or thin API, where the API is defined up front, and the C++ object provides the implementation, most of which is private to the C++ layer. Obviously, reflection is required to expose C++ objects to a consuming layer like this -- this paper explores using the Classdesc system to implement reflection of C++ objects into a JavaScript/TypeScript environment via a RESTservice, and also via a Node.js API module.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。