templates - Expose C++ class using duktape -


i in midst of building simple game engine/basic library. right now, i'm working on scripting support. since i've liked javascript more than, say, lua or python, thought using principle scripting language. google v8 struck me first, performance , relatively simple means of exposing class - heavy usage of templates. however, can't seem able compile v8 using mingw on windows - doesn't want to. looked @ chaiscript, interesting - because takes embedding 1 step forward compared v8. is, however, not first choice.

now, question follows. how can achieve exposing complex c++ class duktape? know this question, uses simple foobar-like class. have class:

class entity     {     public:         entity(std::string name_item)         ~entity();          size_t getid();          bool hascomponent(size_t componentid_item);         entitycomponent* getcomponent(size_t componentid_item);         void addcomponent(entitycomponent* component_item);         entitycomponent* removecomponent(size_t componentid_item);         void deletecomponent(size_t componentid_item);     private:         unsigned long long m_id;         std::unordered_map<size_t, entitycomponent*> m_components;     }; 

how go exposing it, can used duktape? also, can somehow automate (or make easier) process using templates, chaiscript (especially) , google v8 heavily do?


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -