1 %module ruby_naming 2 3 %predicate predicateMethod(); 4 %bang bangMethod(); 5 6 /* This gets mapped to a constant */ 7 %constant int constant1 = 1; 8 9 /* This gets mapped to a constant */ 10 #define constant2 2 11 12 %immutable TestConstants::constant8; 13 14 %inline %{ 15 16 /* ============ Test Constants Names ============== */ 17 18 /* This gets mapped to a constant */ 19 #define constant3 3 20 21 /* These are all singleton methods */ 22 const int constant4[2] = {10, 20}; 23 const int constant5 = 5; 24 static const int constant6 = 6; 25 26 27 class TestConstants { 28 public: TestConstants()29 TestConstants() : constant7(7) {} 30 31 /* This gets mapped to a method */ 32 const int constant7; 33 34 /* This gets mapped to a singleton method, but this is not legal C++ */ 35 static const int constant8; 36 37 /* This gets mapped to a method, but this it not legal C++ */ 38 /*const int constant9 = 9;*/ 39 40 /* This gets mapped to a constant */ 41 static const int constant10 = 10; 42 }; 43 44 const int TestConstants::constant8 = 8; 45 46 const TestConstants * constant11[5]; 47 48 49 /* ============ Test Enum ============== */ 50 typedef enum {Red, Green, Blue} Colors; 51 52 53 /* ============ Test Method Names ============== */ 54 class my_class { 55 public: methodOne()56 int methodOne() 57 { 58 return 1; 59 } 60 MethodTwo()61 int MethodTwo() 62 { 63 return 2; 64 } 65 Method_THREE()66 int Method_THREE() 67 { 68 return 3; 69 } 70 Method44_4()71 int Method44_4() 72 { 73 return 4; 74 } 75 predicateMethod()76 bool predicateMethod() 77 { 78 return true; 79 } 80 bangMethod()81 bool bangMethod() 82 { 83 return true; 84 } begin()85 int begin() 86 { 87 return 1; 88 } 89 end()90 int end() 91 { 92 return 1; 93 } 94 95 }; 96 97 %} 98 99 %inline 100 { 101 template <class _Type> 102 struct A 103 { 104 }; 105 } 106 107 %template(A_i) A<int>; 108