Coder Social home page Coder Social logo

cppbinding问题 about sluaunreal HOT 2 CLOSED

jamessg avatar jamessg commented on June 13, 2024
cppbinding问题

from sluaunreal.

Comments (2)

zjhongxian avatar zjhongxian commented on June 13, 2024

1、“比如一些方法返回的是string类型或者参数是string类型,或者map,或者其他自定义类型,但是看demo中都是FString,这种情况如何处理呢?”

这个就需要扩展LuaObject::push函数,把对应的模版完成
image

2、static LuaOwnedPtr create(int v) {
return new FooChild(v);
}

对于这个暂时没什么好办法,不过这个create函数不要求是类的函数,可以是这个类之外的一个static函数就行(避免一定要去扩展这个类)

from sluaunreal.

jamessg avatar jamessg commented on June 13, 2024

2、static LuaOwnedPtr create(int v) { return new FooChild(v); }

对于这个暂时没什么好办法,不过这个create函数不要求是类的函数,可以是这个类之外的一个static函数就行(避免一定要去扩展这个类)

感谢回答,对于第二个问题,如果是类外的一个A类中的static create函数,在写EndDef是如下这样写吗
EndDef(Foo,&A::create)

另外,使用这种方式进行导出,如果导出的类和方法比较多,全部放入luaglobal,会不会存在性能问题呢

from sluaunreal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.