sergey.pozhidaev Posted December 30, 2014 Posted December 30, 2014 hi, i need subj. standart scheme: ExternClass<AClass> *a_c = MakeExternClass<AClass>(); a_c ->addConstructor(); a_c ->addFunction("func1", &AClass::func1); Interpreter::addExternClass("AClass", a_c ); if constructor and destructor is private it does not working. how export class in this case?
unclebob Posted January 7, 2015 Posted January 7, 2015 Hello, Sergey! Could you give me more details of what you're trying to achieve? I think if you want to disable constructor and destructor then you don't want that class instances being created from the outside. That means, you don't want to create ones by using new. So I can assume two cases: 1) Use this class as a 'static function storage'. In that case consider using Interpreter::addExternLibrary and add that static function as a library functions. 2) Prohibit instance creation/deletion by using new/delete keyword. There still have to be a way to create an instance (probably some static class function like AClass::create) and that function could be added as a library function like in the first case and other functions could be added as an extern class functions so try to remove addConstructor call.
Recommended Posts