logo

libbulletml

Library of Bullet Markup Language (forked from https://shinh.skr.jp/libbulletml/index_en.html )git clone https://hacktivis.me/git/libbulletml.git

cpp.cpp (2628B)


  1. class C {
  2. public:
  3. C() {}
  4. C(int a) : a_(a) {}
  5. int a() const { return a_; }
  6. void setA(int a) { a_ = a; }
  7. void f2(int, int) {}
  8. void f3(int, int, int) {}
  9. void f4(int, int, int, int) {}
  10. void f5(int, int, int, int, int) {}
  11. void f6(int, int, int, int, int, int) {}
  12. void f7(int, int, int, int, int, int, int) {}
  13. void f8(int, int, int, int, int, int, int, int) {}
  14. void f9(int, int, int, int, int, int, int, int, int) {}
  15. void over_load(int a) { a_ = a; }
  16. void over_load(char a) { a_ = a-48; }
  17. static int sf0() { return 6; }
  18. static int sf1(int) { return 7; }
  19. private:
  20. int a_;
  21. };
  22. template <class T_> class TC {
  23. public:
  24. T_ f() { return 5; }
  25. template <class T2_>
  26. T2_ tf() { return 6; }
  27. };
  28. class I {
  29. public:
  30. int load_callback() {
  31. return callback();
  32. }
  33. int load_callback2(int x, int y) {
  34. return callback2(x, y);
  35. }
  36. virtual int callback() =0;
  37. virtual int callback2(int, int) =0;
  38. };
  39. #include "d_cpp_interface.h"
  40. extern "C" {
  41. D_CPP_CLASS(C, D_C)
  42. D_CPP_NEW_0(C, D_C_new)
  43. D_CPP_NEW_1(C, D_C_new_1, int)
  44. D_CPP_DELETE(C, D_C_delete)
  45. D_CPP_METHOD_0(C, a, D_C_a, int)
  46. D_CPP_METHOD_1(C, setA, D_C_setA, void, int)
  47. D_CPP_METHOD_2(C, f2, D_C_f2, void, int, int)
  48. D_CPP_METHOD_3(C, f3, D_C_f3, void, int, int, int)
  49. D_CPP_METHOD_4(C, f4, D_C_f4, void, int, int, int, int)
  50. D_CPP_METHOD_5(C, f5, D_C_f5, void, int, int, int, int, int)
  51. D_CPP_METHOD_6(C, f6, D_C_f6, void, int, int, int, int, int, int)
  52. D_CPP_METHOD_7(C, f7, D_C_f7, void, int, int, int, int, int, int, int)
  53. D_CPP_METHOD_8(C, f8, D_C_f8, void, int, int, int, int, int, int, int, int)
  54. D_CPP_METHOD_9(C, f9, D_C_f9, void, int, int, int, int, int, int, int, int, int)
  55. D_CPP_METHOD_1(C, over_load, D_C_over_load_int, void, int)
  56. D_CPP_METHOD_1(C, over_load, D_C_over_load_char, void, char)
  57. D_CPP_CLASS(TC<int>, D_TC_int)
  58. D_CPP_NEW_0(TC<int>, D_TC_int_new)
  59. D_CPP_METHOD_0(TC<int>, f, D_TC_int_f, int)
  60. D_CPP_METHOD_0(TC<int>, tf<int>, D_TC_int_tf, int)
  61. D_CPP_DELETE(TC<int>, D_TC_int_delete)
  62. D_CPP_STATIC_METHOD_0(C, sf0, D_C_sf0, int)
  63. D_CPP_STATIC_METHOD_1(C, sf1, D_C_sf1, int, int)
  64. }
  65. // inherit
  66. D_CPP_BASE_CLASS_OPEN(I, D_I)
  67. D_CPP_VIRTUAL_METHOD_0(D_I, callback, int)
  68. D_CPP_VIRTUAL_METHOD_2(D_I, callback2, int, int, int)
  69. D_CPP_BASE_CLASS_CLOSE()
  70. extern "C" {
  71. D_CPP_CLASS(D_I, D_I)
  72. D_CPP_NEW_0(D_I, D_I_new)
  73. D_CPP_METHOD_0(D_I, load_callback, D_I_load_callback, int)
  74. D_CPP_METHOD_2(D_I, load_callback2, D_I_load_callback2, int, int, int)
  75. D_CPP_VIRTUAL_METHOD_SETTER_0(D_I, callback, D_I_setCallbackFunc, int)
  76. D_CPP_VIRTUAL_METHOD_SETTER_2(D_I, callback2, D_I_setCallback2Func, int, int, int)
  77. D_CPP_DELETE(D_I, D_I_delete)
  78. }