git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7315 626c5289-ae23-0410-ae9c-e8d60b6d4f22
35 lines
595 B
OpenEdge ABL
35 lines
595 B
OpenEdge ABL
%module extend_variable
|
|
|
|
// Tests %extend for variables
|
|
|
|
%inline %{
|
|
class ExtendMe {
|
|
double var;
|
|
public:
|
|
ExtendMe() : var(0.0) {}
|
|
bool get(double &d) {
|
|
d = var;
|
|
return true;
|
|
}
|
|
bool set(const double &d) {
|
|
var = d;
|
|
return true;
|
|
}
|
|
};
|
|
%}
|
|
|
|
%extend ExtendMe {
|
|
double ExtendVar;
|
|
};
|
|
|
|
%{
|
|
// If possible, all language modules should use this naming format for consistency
|
|
void ExtendMe_ExtendVar_set(ExtendMe *thisptr, double value) {
|
|
thisptr->set(value);
|
|
}
|
|
double ExtendMe_ExtendVar_get(ExtendMe *thisptr) {
|
|
double value = 0;
|
|
thisptr->get(value);
|
|
return value;
|
|
}
|
|
%}
|