C#, D, Java methodmodifiers on destructors

Add support so that the %csmethodmodifiers, %dmethodmodifiers,
%javamethodmodifiers can modify the method modifiers for the destructor wrappers
in the proxy class: dispose, Dispose, delete. With this feature, it is now possible
to make a C# proxy class sealed, eg when wrapping a class X, the virtual method modifiers
can be removed using:

  %typemap(csclassmodifiers) X "public sealed class"
  %csmethodmodifiers X::~X "public /*virtual*/";
This commit is contained in:
William S Fulton 2018-05-11 18:09:51 +01:00
commit ee17f8d04f
9 changed files with 210 additions and 13 deletions

View file

@ -6560,6 +6560,8 @@ used for all proxy classes except those which have a base class
<br>
Note that the <tt>delete()</tt> method name is configurable and is specified by the <tt>methodname</tt> attribute.
The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
</div>
<p><tt>%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized")</tt></p>
@ -6571,6 +6573,8 @@ same as "javadestruct" but only used for derived proxy classes
<br>
Note that the <tt>delete()</tt> method name is configurable and is specified by the <tt>methodname</tt> attribute.
The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
</div>
<p><tt>%typemap(javaimports)</tt></p>