Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
I need to force users of the generated Java interface to use factory method
in order to instantiate some class, so I need to prevent it from being
created using default constructor. I know it is possible in C++ adding a
no-arg constructor in private area, but can I do it with C and %extend?
Also my previous question about SWIG run-time was never answered. Shortly,
if compiling more than one module (%module statement) into a single shared
library there are compilation warnings about duplicate definitions. I
thought '-noruntime' would solve the issue, but it was said deprecated.
Then I found SWIG_NOINCLUDE which solved the problem, but is it a correct
way for excluding SWIG run-time out of generated code? It would be nice if
you state in documentation in favor of what '-noruntime' was deprecated.
There is corresponding question on StackOverflow
Thank you in advance!
From: William S Fulton <wsf@fu...> - 2013-10-21 20:01:48
On 18/10/13 08:02, Alexander Solovets wrote:
> I need to force users of the generated Java interface to use factory method
> in order to instantiate some class, so I need to prevent it from being
> created using default constructor. I know it is possible in C++ adding a
> no-arg constructor in private area, but can I do it with C and %extend?
Yes, you can add in constructors and destructors in %extend for C code,