MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / add_class

Function add_class

include/chaiscript/utility/utility.hpp:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 ///
52 template<typename Class, typename ModuleType>
53 void add_class(ModuleType &t_module,
54 const std::string &t_class_name,
55 const std::vector<chaiscript::Proxy_Function> &t_constructors,
56 const std::vector<std::pair<chaiscript::Proxy_Function, std::string>> &t_funcs)
57 {
58 t_module.add(chaiscript::user_type<Class>(), t_class_name);
59
60 for(const chaiscript::Proxy_Function &ctor: t_constructors)
61 {
62 t_module.add(ctor, t_class_name);
63 }
64
65 for(const auto &fun: t_funcs)
66 {
67 t_module.add(fun.first, fun.second);
68 }
69 }
70
71 template<typename Enum, typename ModuleType>
72 typename std::enable_if<std::is_enum<Enum>::value, void>::type

Callers

nothing calls this directly

Calls 4

funFunction · 0.85
const_varFunction · 0.85
add_global_constMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected