/* * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NATIVE_RDB_VALUES_BUCKETS_H #define NATIVE_RDB_VALUES_BUCKETS_H #include #include #include #include "value_object.h" #include "values_bucket.h" namespace OHOS { namespace NativeRdb { class API_EXPORT ValuesBuckets { public: using FieldsType = std::shared_ptr>; using ValuesType = std::shared_ptr>; using FieldType = std::reference_wrapper; using ValueType = std::reference_wrapper; using BucketType = std::map>; API_EXPORT ValuesBuckets(); API_EXPORT size_t RowSize() const; API_EXPORT std::pair GetFieldsAndValues() const; API_EXPORT void Put(const ValuesBucket &bucket); API_EXPORT std::pair Get(size_t row, const FieldType &field) const; private: FieldsType fields_; ValuesType values_; std::vector buckets_; }; } // namespace NativeRdb } // namespace OHOS #endif