|
| 1 | +/* |
| 2 | + Copyright (c) 2017 TOSHIBA Digital Solutions Corporation. |
| 3 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + you may not use this file except in compliance with the License. |
| 5 | + You may obtain a copy of the License at |
| 6 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + Unless required by applicable law or agreed to in writing, software |
| 8 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | + See the License for the specific language governing permissions and |
| 11 | + limitations under the License. |
| 12 | +*/ |
| 13 | + |
| 14 | +#include "RowList.h" |
| 15 | + |
| 16 | +namespace griddb { |
| 17 | + |
| 18 | + RowList::RowList(GSRow *gsRow, GSRowSet *gsRowSet, GSType *typelist, |
| 19 | + int columnCount, bool timetampFloat) : |
| 20 | + mRowSet(gsRowSet), mRow(gsRow), mTypelist(typelist), |
| 21 | + mColumnCount(columnCount), mTimetampFloat(timetampFloat) { |
| 22 | + } |
| 23 | + |
| 24 | + /** |
| 25 | + * Support iterator object. |
| 26 | + */ |
| 27 | + RowList* RowList::__iter__() { |
| 28 | + return this; |
| 29 | + } |
| 30 | + |
| 31 | + /** |
| 32 | + * Support iterator object: get next row |
| 33 | + */ |
| 34 | + void RowList::__next__(bool* hasRow) { |
| 35 | + *hasRow = gsHasNextRow(mRowSet); |
| 36 | + if (*hasRow) { |
| 37 | + gsGetNextRow(mRowSet, mRow); |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + * Refer GSRow pointer from RowSet |
| 43 | + */ |
| 44 | + GSRow* RowList::get_gsrow_ptr() { |
| 45 | + return this->mRow; |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * Refer GSType pointer from RowSet |
| 50 | + */ |
| 51 | + GSType* RowList::get_gstype_list() { |
| 52 | + return mTypelist; |
| 53 | + } |
| 54 | + |
| 55 | + /** |
| 56 | + * Refer number column from RowSet |
| 57 | + */ |
| 58 | + int RowList::get_column_count() { |
| 59 | + return mColumnCount; |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Refer number column from RowSet |
| 64 | + */ |
| 65 | + bool RowList::get_timestamp_to_float() { |
| 66 | + return mTimetampFloat; |
| 67 | + } |
| 68 | + |
| 69 | +} // namespace griddb |
0 commit comments