File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,31 @@ void rnum::CPP_RationalNumberArray::setError(const RNAErrorCode errorCode) {
335
335
this ->m_errorCallback (*this );
336
336
}
337
337
338
+ rnum::CPP_RationalNumberArray rnum::CPP_RationalNumberArray::operator =
339
+ (const rnum::CPP_RationalNumberArray &right) {
340
+ if ( this == &right ){
341
+ return *this ;
342
+ }
343
+ this ->m_size = right.m_size ;
344
+ this ->m_capacity = right.m_capacity ;
345
+ delete[] this ->m_data ;
346
+ this ->m_data = new CPP_RationalNumber[this ->m_capacity ];
347
+ for (unsigned int i = 0 ; i < right.m_size ; i++){
348
+ this ->m_data [i]= right.m_data [i];
349
+ }
350
+ return *this ;
351
+ }
352
+
353
+ const rnum::CPP_RationalNumber& rnum::CPP_RationalNumberArray::operator []
354
+ (const unsigned int &index) const {
355
+ return this ->m_data [ index];
356
+ }
357
+
358
+ rnum::CPP_RationalNumber& rnum::CPP_RationalNumberArray::operator []
359
+ (const unsigned int &index) {
360
+ return this ->m_data [index];
361
+ }
362
+
338
363
339
364
/* void rnum::CPP_RationalNumberArray::initializeWithNullRationalNumber(const unsigned int from, const unsigned int to) {
340
365
for (unsigned int i = from; i < to; i++) {
Original file line number Diff line number Diff line change @@ -94,6 +94,17 @@ public :
94
94
RNAErrorCode rnaError (void ) const ;
95
95
void rnaSetErrorCallback (const cppErrorCallback_t callback);
96
96
97
+ CPP_RationalNumberArray operator =
98
+ (const CPP_RationalNumberArray &right);
99
+
100
+ const CPP_RationalNumber& operator []
101
+ (const unsigned int &index) const ;
102
+
103
+ CPP_RationalNumber& operator []
104
+ (const unsigned int &index) ;
105
+
106
+
107
+
97
108
private:
98
109
99
110
void setError (const RNAErrorCode errorCode);
@@ -108,6 +119,10 @@ public :
108
119
109
120
cppErrorCallback_t m_errorCallback;
110
121
122
+ bool operator ==
123
+ (const RationalNumberArray & rna) const {
124
+ return false ;
125
+ }
111
126
};
112
127
}
113
128
You can’t perform that action at this time.
0 commit comments