Created
April 28, 2024 17:04
-
-
Save traversaro/45c5265b57eaa6c671a6d732724c79d9 to your computer and use it in GitHub Desktop.
Swig Friend Method Minimum Reproducible Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testswig.h" | |
ClassWithProtectedFriendMethod::ClassWithProtectedFriendMethod() | |
{ | |
} | |
ClassWithProtectedFriendMethod::protectedFriendMethod() | |
{ | |
return -42.0; | |
} | |
ClassWithProtectedFriendMethod::publicMethod() | |
{ | |
return 42.0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef SWIGEXAMPLE_H | |
#define SWIGEXAMPLE_H | |
/** | |
* \ingroup functionEncoder | |
* | |
* Encode any given function as a set of wavelet coefficients. | |
* The father wavelet used here is the \b db4. | |
*/ | |
class ClassWithProtectedFriendMethod | |
{ | |
protected: | |
friend double protectedFriendMethod(); | |
public: | |
/** | |
* Constructor. | |
*/ | |
ClassWithProtectedFriendMethod(); | |
double publicMethod(); | |
}; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%module testswig | |
%{ | |
#include "testswig.h" | |
%} | |
%include "testswig.h" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment