Use public visibility for pointer constructor and getCPtr() when using nspace fixes and docs

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12888 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-12-23 20:03:09 +00:00
commit 5ef2affe53
2 changed files with 10 additions and 1 deletions

View file

@ -1934,6 +1934,11 @@ in an unnamed package.
</pre> </pre>
</div> </div>
<p>
If the resulting use of the nspace feature and hence packages results in a proxy class in one package deriving or using a proxy class from another package,
you will need to open up the visibility for the pointer constructor and <tt>getCPtr</tt> method from the default 'protected' to 'public' with the <tt>SWIG_JAVABODY_PROXY</tt> macro. See <a href="#Java_code_typemaps">Java code typemaps</a>.
</p>
<H3><a name="Java_templates"></a>24.3.14 C++ templates</H3> <H3><a name="Java_templates"></a>24.3.14 C++ templates</H3>
@ -5585,7 +5590,7 @@ Again this is the same that is in "<tt>java.swg</tt>", barring the method modifi
</p> </p>
<p> <p>
When using <a href="Modules.html">multiple modules</a> it is common to invoke SWIG with a different <tt>-package</tt> When using <a href="Modules.html">multiple modules</a> or the <a href="#Java_namespaces">nspace feature</a> it is common to invoke SWIG with a different <tt>-package</tt>
command line option for each module. command line option for each module.
However, by default the generated code may not compile if However, by default the generated code may not compile if
generated classes in one package use generated classes in another package. generated classes in one package use generated classes in another package.

View file

@ -4,6 +4,10 @@
// nspace feature only supported by these languages // nspace feature only supported by these languages
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGD) #if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGD)
#if defined(SWIGJAVA)
SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
#endif
%nspace; %nspace;
%nonspace Outer::Inner2::NoNSpacePlease; %nonspace Outer::Inner2::NoNSpacePlease;