Change naming convention for wrapped ctors and dtor
Use Foo_{new,delete}() instead of {new,delete}_Foo() to ensure that all
methods of the class Foo start with the corresponding prefix.
This commit is contained in:
parent
b24665fa6a
commit
bda731cd8f
23 changed files with 95 additions and 87 deletions
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
printf("Creating some objects:\n");
|
||||
Circle* c = new_Circle(10);
|
||||
Circle* c = Circle_new(10);
|
||||
printf(" Created circle\n");
|
||||
Square* s = new_Square(10);
|
||||
Square* s = Square_new(10);
|
||||
printf(" Created square\n");
|
||||
|
||||
printf("\nA total of %d shapes were created\n", Shape_nshapes_get());
|
||||
|
|
@ -33,8 +33,8 @@ int main(int argc, char **argv) {
|
|||
|
||||
printf("\nGuess I'll clean up now\n");
|
||||
|
||||
delete_Square(s);
|
||||
delete_Circle(c);
|
||||
Square_delete(s);
|
||||
Circle_delete(c);
|
||||
|
||||
printf("%d shapes remain\n", Shape_nshapes_get());
|
||||
printf("Goodbye\n");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "example_wrap.h"
|
||||
|
||||
int main() {
|
||||
Test *t = new_Test();
|
||||
Test *t = Test_new();
|
||||
|
||||
SWIG_try {
|
||||
Test_unknown(t);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "example_wrap.h"
|
||||
|
||||
int main() {
|
||||
Klass *klass = new_Klass();
|
||||
Klass *klass = Klass_new();
|
||||
Vint *vint = Klass_vi_get(klass);
|
||||
VA *va = Klass_va_get(klass);
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ int main() {
|
|||
printf("\nVector of objects:\n");
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
A *a = new_A_std_string_i("hello", i);
|
||||
A *a = A_new_std_string_i("hello", i);
|
||||
VA_push_back(va, a);
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ int main() {
|
|||
printf("%s %d\n", A_name_get(a), A_value_get(a));
|
||||
}
|
||||
|
||||
delete_Klass(klass);
|
||||
Klass_delete(klass);
|
||||
|
||||
SWIG_exit(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue