tatara 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +23 -0
- data/Gemfile.lock +2 -2
- data/README.md +4 -0
- data/docs/_config.yml +1 -0
- data/docs/index.md +100 -0
- data/docs/tatara/float.md +425 -0
- data/docs/tatara/float_array.md +256 -0
- data/docs/tatara/float_float_map.md +52 -0
- data/docs/tatara/float_integer_map.md +52 -0
- data/docs/tatara/float_string_map.md +52 -0
- data/docs/tatara/float_vector.md +269 -0
- data/docs/tatara/integer.md +480 -0
- data/docs/tatara/integer_array.md +256 -0
- data/docs/tatara/integer_float_map.md +52 -0
- data/docs/tatara/integer_integer_map.md +52 -0
- data/docs/tatara/integer_string_map.md +52 -0
- data/docs/tatara/integer_vector.md +268 -0
- data/docs/tatara/string.md +223 -0
- data/docs/tatara/string_array.md +254 -0
- data/docs/tatara/string_float_map.md +56 -0
- data/docs/tatara/string_int_map.md +55 -0
- data/docs/tatara/string_string_map.md +55 -0
- data/docs/tatara/string_vector.md +270 -0
- data/ext/tatara/array/array.hpp +60 -0
- data/ext/tatara/float/float.hpp +51 -0
- data/ext/tatara/integer/integer.hpp +67 -0
- data/ext/tatara/string/string.hpp +28 -0
- data/ext/tatara/tatara.cpp +138 -9
- data/ext/tatara/vector/vector.hpp +60 -0
- data/lib/tatara.rb +2 -0
- data/lib/tatara/array/array.rb +37 -0
- data/lib/tatara/tatara_ext.rb +6 -0
- data/lib/tatara/vector/vector.rb +37 -0
- data/lib/tatara/version.rb +1 -1
- metadata +27 -3
data/ext/tatara/float/float.hpp
CHANGED
@@ -9,13 +9,23 @@ class Float {
|
|
9
9
|
public:
|
10
10
|
constexpr Float();
|
11
11
|
~Float();
|
12
|
+
constexpr Float& initialize_object(const double var);
|
12
13
|
constexpr double assignment(const double var);
|
13
14
|
constexpr double return_value();
|
14
15
|
constexpr double increment_value();
|
15
16
|
constexpr double decrement_value();
|
16
17
|
std::string to_string();
|
17
18
|
constexpr int to_integer();
|
19
|
+
constexpr double plus(const double var);
|
18
20
|
constexpr double plus_equal(const double var);
|
21
|
+
constexpr double minus(const double var);
|
22
|
+
constexpr double minus_equal(const double var);
|
23
|
+
constexpr double multiply(const double var);
|
24
|
+
constexpr double multiply_equal(const double var);
|
25
|
+
constexpr double divided(const double var);
|
26
|
+
constexpr double divided_equal(const double var);
|
27
|
+
constexpr double power(const double var);
|
28
|
+
constexpr double power_equal(const double var);
|
19
29
|
constexpr double clear();
|
20
30
|
constexpr bool equal(const double var);
|
21
31
|
};
|
@@ -24,6 +34,11 @@ constexpr Float::Float() {}
|
|
24
34
|
|
25
35
|
Float::~Float() {}
|
26
36
|
|
37
|
+
constexpr Float& Float::initialize_object(const double var) {
|
38
|
+
this->value = var;
|
39
|
+
return *this;
|
40
|
+
}
|
41
|
+
|
27
42
|
constexpr double Float::assignment(const double var) {
|
28
43
|
return this->value = var;
|
29
44
|
}
|
@@ -53,10 +68,46 @@ constexpr int Float::to_integer() {
|
|
53
68
|
return static_cast<int>(this->value);
|
54
69
|
}
|
55
70
|
|
71
|
+
constexpr double Float::plus(const double var) {
|
72
|
+
return this->value + var;
|
73
|
+
}
|
74
|
+
|
56
75
|
constexpr double Float::plus_equal(const double var) {
|
57
76
|
return this->value += var;
|
58
77
|
}
|
59
78
|
|
79
|
+
constexpr double Float::minus(const double var) {
|
80
|
+
return this->value - var;
|
81
|
+
}
|
82
|
+
|
83
|
+
constexpr double Float::minus_equal(const double var) {
|
84
|
+
return this->value -= var;
|
85
|
+
}
|
86
|
+
|
87
|
+
constexpr double Float::multiply(const double var) {
|
88
|
+
return this->value * var;
|
89
|
+
}
|
90
|
+
|
91
|
+
constexpr double Float::multiply_equal(const double var) {
|
92
|
+
return this->value *= var;
|
93
|
+
}
|
94
|
+
|
95
|
+
constexpr double Float::divided(const double var) {
|
96
|
+
return this->value / var;
|
97
|
+
}
|
98
|
+
|
99
|
+
constexpr double Float::divided_equal(const double var) {
|
100
|
+
return this->value /= var;
|
101
|
+
}
|
102
|
+
|
103
|
+
constexpr double Float::power(const double var) {
|
104
|
+
return std::pow(this->value, var);
|
105
|
+
}
|
106
|
+
|
107
|
+
constexpr double Float::power_equal(const double var) {
|
108
|
+
return this->value = std::pow(this->value, var);
|
109
|
+
}
|
110
|
+
|
60
111
|
constexpr double Float::clear() {
|
61
112
|
return this->value = 0.0;
|
62
113
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
#define INTEGER_H_
|
3
3
|
|
4
4
|
#include <string>
|
5
|
+
#include <cmath>
|
5
6
|
|
6
7
|
class Integer {
|
7
8
|
int value = 0;
|
@@ -9,12 +10,25 @@ class Integer {
|
|
9
10
|
public:
|
10
11
|
constexpr Integer();
|
11
12
|
~Integer();
|
13
|
+
constexpr Integer& initialize_object(const int var);
|
12
14
|
constexpr int assignment(const int var);
|
13
15
|
constexpr int return_value();
|
14
16
|
constexpr int increment_value();
|
15
17
|
constexpr int decrement_value();
|
16
18
|
std::string to_string();
|
19
|
+
constexpr double to_float();
|
20
|
+
constexpr int plus(int var);
|
17
21
|
constexpr int plus_equal(int var);
|
22
|
+
constexpr int minus(int var);
|
23
|
+
constexpr int minus_equal(int var);
|
24
|
+
constexpr int divided(int var);
|
25
|
+
constexpr int divided_equal(int var);
|
26
|
+
constexpr int multiply(int var);
|
27
|
+
constexpr int multiply_equal(int var);
|
28
|
+
constexpr int mod(int var);
|
29
|
+
constexpr int mod_equal(int var);
|
30
|
+
constexpr int power(int var);
|
31
|
+
constexpr int power_equal(int var);
|
18
32
|
constexpr int clear();
|
19
33
|
constexpr bool equal(const int var);
|
20
34
|
};
|
@@ -23,6 +37,11 @@ constexpr Integer::Integer() {}
|
|
23
37
|
|
24
38
|
Integer::~Integer(){}
|
25
39
|
|
40
|
+
constexpr Integer& Integer::initialize_object(const int var) {
|
41
|
+
this->value = var;
|
42
|
+
return *this;
|
43
|
+
}
|
44
|
+
|
26
45
|
constexpr int Integer::assignment(const int var) {
|
27
46
|
return this->value = var;
|
28
47
|
}
|
@@ -43,10 +62,58 @@ std::string Integer::to_string() {
|
|
43
62
|
return std::to_string(this->value);
|
44
63
|
}
|
45
64
|
|
65
|
+
constexpr double Integer::to_float() {
|
66
|
+
return static_cast<double>(this->value);
|
67
|
+
}
|
68
|
+
|
69
|
+
constexpr int Integer::plus(int var) {
|
70
|
+
return this->value + var;
|
71
|
+
}
|
72
|
+
|
46
73
|
constexpr int Integer::plus_equal(int var) {
|
47
74
|
return this->value += var;
|
48
75
|
}
|
49
76
|
|
77
|
+
constexpr int Integer::minus(int var) {
|
78
|
+
return this->value - var;
|
79
|
+
}
|
80
|
+
|
81
|
+
constexpr int Integer::minus_equal(int var) {
|
82
|
+
return this->value -= var;
|
83
|
+
}
|
84
|
+
|
85
|
+
constexpr int Integer::divided(int var) {
|
86
|
+
return this->value / var;
|
87
|
+
}
|
88
|
+
|
89
|
+
constexpr int Integer::divided_equal(int var) {
|
90
|
+
return this->value /= var;
|
91
|
+
}
|
92
|
+
|
93
|
+
constexpr int Integer::multiply(int var) {
|
94
|
+
return this->value * var;
|
95
|
+
}
|
96
|
+
|
97
|
+
constexpr int Integer::multiply_equal(int var) {
|
98
|
+
return this->value *= var;
|
99
|
+
}
|
100
|
+
|
101
|
+
constexpr int Integer::mod(int var) {
|
102
|
+
return this->value % var;
|
103
|
+
}
|
104
|
+
|
105
|
+
constexpr int Integer::mod_equal(int var) {
|
106
|
+
return this->value %= var;
|
107
|
+
}
|
108
|
+
|
109
|
+
constexpr int Integer::power(int var) {
|
110
|
+
return std::pow(this->value, var);
|
111
|
+
}
|
112
|
+
|
113
|
+
constexpr int Integer::power_equal(int var) {
|
114
|
+
return this->value = std::pow(this->value, var);
|
115
|
+
}
|
116
|
+
|
50
117
|
constexpr int Integer::clear() {
|
51
118
|
return this->value = 0;
|
52
119
|
}
|
@@ -8,18 +8,28 @@ class CppString {
|
|
8
8
|
public:
|
9
9
|
CppString();
|
10
10
|
~CppString();
|
11
|
+
CppString& initialize_object(const std::string var);
|
11
12
|
std::string assignment(const std::string var);
|
12
13
|
std::string return_value();
|
14
|
+
std::string index_access(const int index);
|
13
15
|
int to_integer();
|
16
|
+
double to_float();
|
14
17
|
std::string plus_equal(const std::string var);
|
15
18
|
std::string clear();
|
16
19
|
bool equal(const std::string var);
|
20
|
+
std::string slice(const int start, const int end);
|
21
|
+
std::string slice_des(const int start, const int end);
|
17
22
|
};
|
18
23
|
|
19
24
|
CppString::CppString() {}
|
20
25
|
|
21
26
|
CppString::~CppString() {}
|
22
27
|
|
28
|
+
CppString& CppString::initialize_object(const std::string var) {
|
29
|
+
this->value = var;
|
30
|
+
return *this;
|
31
|
+
}
|
32
|
+
|
23
33
|
std::string CppString::assignment(const std::string var) {
|
24
34
|
return this->value = var;
|
25
35
|
}
|
@@ -28,10 +38,19 @@ std::string CppString::return_value() {
|
|
28
38
|
return this->value;
|
29
39
|
}
|
30
40
|
|
41
|
+
std::string CppString::index_access(const int index) {
|
42
|
+
std::string s{this->value[index]};
|
43
|
+
return s;
|
44
|
+
}
|
45
|
+
|
31
46
|
int CppString::to_integer() {
|
32
47
|
return std::stoi(this->value);
|
33
48
|
}
|
34
49
|
|
50
|
+
double CppString::to_float() {
|
51
|
+
return std::stof(this->value);
|
52
|
+
}
|
53
|
+
|
35
54
|
std::string CppString::plus_equal(const std::string var) {
|
36
55
|
return this->value += var;
|
37
56
|
}
|
@@ -44,4 +63,13 @@ bool CppString::equal(const std::string var) {
|
|
44
63
|
return this->value == var;
|
45
64
|
}
|
46
65
|
|
66
|
+
std::string CppString::slice(const int start, const int end) {
|
67
|
+
return this->value.substr(start, end);
|
68
|
+
}
|
69
|
+
|
70
|
+
std::string CppString::slice_des(const int start, const int end) {
|
71
|
+
this->value = this->value.substr(start, end);
|
72
|
+
return this->value;
|
73
|
+
}
|
74
|
+
|
47
75
|
#endif
|
data/ext/tatara/tatara.cpp
CHANGED
@@ -17,34 +17,97 @@ extern "C" {
|
|
17
17
|
Data_Type<Integer> rbcInteger = define_class_under<Integer>(rb_mTatara, "Integer")
|
18
18
|
.define_constructor(Constructor<Integer>())
|
19
19
|
.define_method("value", &Integer::return_value)
|
20
|
+
.define_method("val", &Integer::return_value)
|
20
21
|
.define_method("value=", &Integer::assignment)
|
22
|
+
.define_method("val=", &Integer::assignment)
|
23
|
+
.define_method("value+", &Integer::plus)
|
24
|
+
.define_method("val+", &Integer::plus)
|
21
25
|
.define_method("value+=", &Integer::plus_equal)
|
26
|
+
.define_method("val+=", &Integer::plus_equal)
|
27
|
+
.define_method("value-", &Integer::minus)
|
28
|
+
.define_method("val-", &Integer::minus)
|
29
|
+
.define_method("value-=", &Integer::minus_equal)
|
30
|
+
.define_method("val-=", &Integer::minus_equal)
|
31
|
+
.define_method("value/", &Integer::divided)
|
32
|
+
.define_method("val/", &Integer::divided)
|
33
|
+
.define_method("value/=", &Integer::divided_equal)
|
34
|
+
.define_method("val/=", &Integer::divided_equal)
|
35
|
+
.define_method("value*", &Integer::multiply)
|
36
|
+
.define_method("val*", &Integer::multiply)
|
37
|
+
.define_method("value*=", &Integer::multiply_equal)
|
38
|
+
.define_method("val*=", &Integer::multiply_equal)
|
39
|
+
.define_method("value%", &Integer::mod)
|
40
|
+
.define_method("value%=", &Integer::mod_equal)
|
41
|
+
.define_method("value**", &Integer::power)
|
42
|
+
.define_method("val**", &Integer::power)
|
43
|
+
.define_method("value**=", &Integer::power_equal)
|
44
|
+
.define_method("val**=", &Integer::power_equal)
|
22
45
|
.define_method("inc", &Integer::increment_value)
|
46
|
+
.define_method("increment", &Integer::increment_value)
|
23
47
|
.define_method("dec", &Integer::decrement_value)
|
48
|
+
.define_method("decrement", &Integer::decrement_value)
|
24
49
|
.define_method("to_s", &Integer::to_string)
|
50
|
+
.define_method("to_f", &Integer::to_float)
|
25
51
|
.define_method("clear", &Integer::clear)
|
26
|
-
.define_method("value==", &Integer::equal)
|
52
|
+
.define_method("value==", &Integer::equal)
|
53
|
+
.define_method("val==", &Integer::equal)
|
54
|
+
.define_method("equal?", &Integer::equal)
|
55
|
+
.define_method("<<", &Integer::initialize_object);
|
27
56
|
|
28
57
|
Data_Type<Float> rbcFloat = define_class_under<Float>(rb_mTatara, "Float")
|
29
58
|
.define_constructor(Constructor<Float>())
|
30
59
|
.define_method("value", &Float::return_value)
|
60
|
+
.define_method("val", &Float::return_value)
|
31
61
|
.define_method("value=", &Float::assignment)
|
62
|
+
.define_method("val=", &Float::assignment)
|
63
|
+
.define_method("value+", &Float::plus)
|
64
|
+
.define_method("val+", &Float::plus)
|
32
65
|
.define_method("value+=", &Float::plus_equal)
|
66
|
+
.define_method("val+=", &Float::plus_equal)
|
67
|
+
.define_method("value-", &Float::minus)
|
68
|
+
.define_method("val-", &Float::minus)
|
69
|
+
.define_method("value-=", &Float::minus_equal)
|
70
|
+
.define_method("val-=", &Float::minus_equal)
|
71
|
+
.define_method("value*", &Float::multiply)
|
72
|
+
.define_method("val*", &Float::multiply)
|
73
|
+
.define_method("value*=", &Float::multiply_equal)
|
74
|
+
.define_method("val*=", &Float::multiply_equal)
|
75
|
+
.define_method("value/", &Float::divided)
|
76
|
+
.define_method("val/", &Float::divided)
|
77
|
+
.define_method("value/=", &Float::divided_equal)
|
78
|
+
.define_method("val/=", &Float::divided_equal)
|
79
|
+
.define_method("value**", &Float::power)
|
80
|
+
.define_method("val**", &Float::power)
|
81
|
+
.define_method("value**=", &Float::power_equal)
|
82
|
+
.define_method("val**=", &Float::power_equal)
|
33
83
|
.define_method("inc", &Float::increment_value)
|
34
84
|
.define_method("dec", &Float::decrement_value)
|
35
85
|
.define_method("to_s", &Float::to_string)
|
36
86
|
.define_method("to_i", &Float::to_integer)
|
37
87
|
.define_method("clear", &Float::clear)
|
38
|
-
.define_method("value==", &Float::equal)
|
88
|
+
.define_method("value==", &Float::equal)
|
89
|
+
.define_method("val==", &Float::equal)
|
90
|
+
.define_method("equal?", &Float::equal)
|
91
|
+
.define_method("<<", &Float::initialize_object);
|
39
92
|
|
40
93
|
Data_Type<CppString> rbcString = define_class_under<CppString>(rb_mTatara, "String")
|
41
94
|
.define_constructor(Constructor<CppString>())
|
42
95
|
.define_method("value", &CppString::return_value)
|
96
|
+
.define_method("val", &CppString::return_value)
|
43
97
|
.define_method("value=", &CppString::assignment)
|
98
|
+
.define_method("val=", &CppString::assignment)
|
44
99
|
.define_method("value+=", &CppString::plus_equal)
|
100
|
+
.define_method("val+=", &CppString::plus_equal)
|
45
101
|
.define_method("to_i", &CppString::to_integer)
|
102
|
+
.define_method("to_f", &CppString::to_float)
|
46
103
|
.define_method("clear", &CppString::clear)
|
47
|
-
.define_method("value==", &CppString::equal)
|
104
|
+
.define_method("value==", &CppString::equal)
|
105
|
+
.define_method("val==", &CppString::equal)
|
106
|
+
.define_method("equal?", &CppString::equal)
|
107
|
+
.define_method("<<", &CppString::initialize_object)
|
108
|
+
.define_method("[]", &CppString::index_access)
|
109
|
+
.define_method("slice", &CppString::slice)
|
110
|
+
.define_method("slice!", &CppString::slice_des);
|
48
111
|
|
49
112
|
Data_Type<Vector<int>> rb_cIntVector = define_class_under<Vector<int>>(rb_mTatara, "IntVector")
|
50
113
|
.define_constructor(Constructor<Vector<int>>())
|
@@ -55,7 +118,13 @@ extern "C" {
|
|
55
118
|
.define_method("emplace_back", &Vector<int>::emplace_back)
|
56
119
|
.define_method("size", &Vector<int>::size)
|
57
120
|
.define_method("clear", &Vector<int>::clear)
|
58
|
-
.define_method("sum", &Vector<int>::sum)
|
121
|
+
.define_method("sum", &Vector<int>::sum)
|
122
|
+
.define_method("<<", &Vector<int>::push_back_object)
|
123
|
+
.define_method("intersection", &Vector<int>::intersection)
|
124
|
+
.define_method("sort", &Vector<int>::sort)
|
125
|
+
.define_method("sort!", &Vector<int>::destructive_sort)
|
126
|
+
.define_method("reverse", &Vector<int>::reverse)
|
127
|
+
.define_method("reverse!", &Vector<int>::destructive_reverse);
|
59
128
|
|
60
129
|
Data_Type<Vector<double>> rb_cFloatVector = define_class_under<Vector<double>>(rb_mTatara, "FloatVector")
|
61
130
|
.define_constructor(Constructor<Vector<double>>())
|
@@ -66,7 +135,13 @@ extern "C" {
|
|
66
135
|
.define_method("emplace_back", &Vector<double>::emplace_back)
|
67
136
|
.define_method("size", &Vector<double>::size)
|
68
137
|
.define_method("clear", &Vector<double>::clear)
|
69
|
-
.define_method("sum", &Vector<double>::sum)
|
138
|
+
.define_method("sum", &Vector<double>::sum)
|
139
|
+
.define_method("<<", &Vector<double>::push_back_object)
|
140
|
+
.define_method("intersection", &Vector<double>::intersection)
|
141
|
+
.define_method("sort", &Vector<double>::sort)
|
142
|
+
.define_method("sort!", &Vector<double>::destructive_sort)
|
143
|
+
.define_method("reverse", &Vector<double>::reverse)
|
144
|
+
.define_method("reverse!", &Vector<double>::destructive_reverse);
|
70
145
|
|
71
146
|
Data_Type<Vector<std::string>> rb_cStringVector = define_class_under<Vector<std::string>>(rb_mTatara, "StringVector")
|
72
147
|
.define_constructor(Constructor<Vector<std::string>>())
|
@@ -77,7 +152,13 @@ extern "C" {
|
|
77
152
|
.define_method("emplace_back", & Vector<std::string>::emplace_back)
|
78
153
|
.define_method("size", &Vector<std::string>::size)
|
79
154
|
.define_method("clear", &Vector<std::string>::clear)
|
80
|
-
.define_method("sum", &Vector<std::string>::sum)
|
155
|
+
.define_method("sum", &Vector<std::string>::sum)
|
156
|
+
.define_method("<<", &Vector<std::string>::push_back_object)
|
157
|
+
.define_method("intersection", &Vector<std::string>::intersection)
|
158
|
+
.define_method("sort", &Vector<std::string>::sort)
|
159
|
+
.define_method("sort!", &Vector<std::string>::destructive_sort)
|
160
|
+
.define_method("reverse", &Vector<std::string>::reverse)
|
161
|
+
.define_method("reverse!", &Vector<std::string>::destructive_reverse);
|
81
162
|
|
82
163
|
Data_Type<CppArray<int>> rb_cIntArray = define_class_under<CppArray<int>>(rb_mTatara, "IntArray")
|
83
164
|
.define_constructor(Constructor<CppArray<int>>())
|
@@ -87,7 +168,13 @@ extern "C" {
|
|
87
168
|
.define_method("[]=", &CppArray<int>::bracket_equal)
|
88
169
|
.define_method("push", &CppArray<int>::emplace_back)
|
89
170
|
.define_method("size", &CppArray<int>::size)
|
90
|
-
.define_method("clear", &CppArray<int>::clear)
|
171
|
+
.define_method("clear", &CppArray<int>::clear)
|
172
|
+
.define_method("<<", &CppArray<int>::push_back_object)
|
173
|
+
.define_method("intersection", &CppArray<int>::intersection)
|
174
|
+
.define_method("sort", &CppArray<int>::sort)
|
175
|
+
.define_method("sort!", &CppArray<int>::destructive_sort)
|
176
|
+
.define_method("reverse", &CppArray<int>::reverse)
|
177
|
+
.define_method("reverse!", &CppArray<int>::destructive_reverse);
|
91
178
|
|
92
179
|
Data_Type<CppArray<double>> rb_cFloatArray = define_class_under<CppArray<double>>(rb_mTatara, "FloatArray")
|
93
180
|
.define_constructor(Constructor<CppArray<double>>())
|
@@ -97,7 +184,13 @@ extern "C" {
|
|
97
184
|
.define_method("[]=", &CppArray<double>::bracket_equal)
|
98
185
|
.define_method("push", &CppArray<double>::emplace_back)
|
99
186
|
.define_method("size", &CppArray<double>::size)
|
100
|
-
.define_method("clear", &CppArray<double>::clear)
|
187
|
+
.define_method("clear", &CppArray<double>::clear)
|
188
|
+
.define_method("<<", &CppArray<double>::push_back_object)
|
189
|
+
.define_method("intersection", &CppArray<double>::intersection)
|
190
|
+
.define_method("sort", &CppArray<double>::sort)
|
191
|
+
.define_method("sort!", &CppArray<double>::destructive_sort)
|
192
|
+
.define_method("reverse", &CppArray<double>::reverse)
|
193
|
+
.define_method("reverse!", &CppArray<double>::destructive_reverse);
|
101
194
|
|
102
195
|
Data_Type<CppArray<std::string>> rb_cStringArray = define_class_under<CppArray<std::string>>(rb_mTatara, "StringArray")
|
103
196
|
.define_constructor(Constructor<CppArray<std::string>>())
|
@@ -107,7 +200,13 @@ extern "C" {
|
|
107
200
|
.define_method("[]=", &CppArray<std::string>::bracket_equal)
|
108
201
|
.define_method("push", &CppArray<std::string>::emplace_back)
|
109
202
|
.define_method("size", &CppArray<std::string>::size)
|
110
|
-
.define_method("clear", &CppArray<std::string>::clear)
|
203
|
+
.define_method("clear", &CppArray<std::string>::clear)
|
204
|
+
.define_method("<<", &CppArray<std::string>::push_back_object)
|
205
|
+
.define_method("intersection", &CppArray<std::string>::intersection)
|
206
|
+
.define_method("sort", &CppArray<std::string>::sort)
|
207
|
+
.define_method("sort!", &CppArray<std::string>::destructive_sort)
|
208
|
+
.define_method("reverse", &CppArray<std::string>::reverse)
|
209
|
+
.define_method("reverse!", &CppArray<std::string>::destructive_reverse);
|
111
210
|
|
112
211
|
Data_Type<Map<std::string, int>> rb_cStringIntMap = define_class_under<Map<std::string, int>>(rb_mTatara, "StringIntMap")
|
113
212
|
.define_constructor(Constructor<Map<std::string, int>>())
|
@@ -123,5 +222,35 @@ extern "C" {
|
|
123
222
|
.define_constructor(Constructor<Map<std::string, std::string>>())
|
124
223
|
.define_method("[]", &Map<std::string, std::string>::bracket)
|
125
224
|
.define_method("[]=", &Map<std::string, std::string>::bracket_equal);
|
225
|
+
|
226
|
+
Data_Type<Map<int, int>> rb_cIntIntMap = define_class_under<Map<int, int>>(rb_mTatara, "IntIntMap")
|
227
|
+
.define_constructor(Constructor<Map<int, int>>())
|
228
|
+
.define_method("[]", &Map<int, int>::bracket)
|
229
|
+
.define_method("[]=", &Map<int, int>::bracket_equal);
|
230
|
+
|
231
|
+
Data_Type<Map<int, double>> rb_cIntFloatMap = define_class_under<Map<int, double>>(rb_mTatara, "IntFloatMap")
|
232
|
+
.define_constructor(Constructor<Map<int, double>>())
|
233
|
+
.define_method("[]", &Map<int, double>::bracket)
|
234
|
+
.define_method("[]=", &Map<int, double>::bracket_equal);
|
235
|
+
|
236
|
+
Data_Type<Map<int, std::string>> rb_cIntStringMap = define_class_under<Map<int, std::string>>(rb_mTatara, "IntStringMap")
|
237
|
+
.define_constructor(Constructor<Map<int, std::string>>())
|
238
|
+
.define_method("[]", &Map<int, std::string>::bracket)
|
239
|
+
.define_method("[]=", &Map<int, std::string>::bracket_equal);
|
240
|
+
|
241
|
+
Data_Type<Map<double, int>> rb_cFloatIntMap = define_class_under<Map<double, int>>(rb_mTatara, "FloatIntMap")
|
242
|
+
.define_constructor(Constructor<Map<double, int>>())
|
243
|
+
.define_method("[]", &Map<double, int>::bracket)
|
244
|
+
.define_method("[]=", &Map<double, int>::bracket_equal);
|
245
|
+
|
246
|
+
Data_Type<Map<double, double>> rb_cFloatFloatMap = define_class_under<Map<double, double>>(rb_mTatara, "FloatFloatMap")
|
247
|
+
.define_constructor(Constructor<Map<double, double>>())
|
248
|
+
.define_method("[]", &Map<double, double>::bracket)
|
249
|
+
.define_method("[]=", &Map<double, double>::bracket_equal);
|
250
|
+
|
251
|
+
Data_Type<Map<double, std::string>> rb_cFloatStringMap = define_class_under<Map<double, std::string>>(rb_mTatara, "FloatStringMap")
|
252
|
+
.define_constructor(Constructor<Map<double, std::string>>())
|
253
|
+
.define_method("[]", &Map<double, std::string>::bracket)
|
254
|
+
.define_method("[]=", &Map<double, std::string>::bracket_equal);
|
126
255
|
}
|
127
256
|
}
|