[C#] Add code to all non-static methods

Alexander Vostres <[email protected]> Mon, 25 Oct 2021 13:07:54 +0300
Newsgroups gmane.comp.programming.swig
Message-ID <CAGbZuBfmAqS4y=07-9GOxjtfAfzGsCL3+uCrdkEfq-5LpmbVaQ@mail.gmail.com>
Greetings,
Basically, I'd like to add null check to throw NullReference instead of
getting (non-catchable) AccessViolation from the C++ side.
To do this I need to add something along the lines of "if (ptr == null)
throw;" to all the non-static methods.
So far the closest I've got is modifying csout, however, it applies to all
the methods.
Is there any way to apply a modified csout typemap only to non-static
methods? Or is there any other way to insert couple lines of code into all
the methods?

Alex

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user