1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 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 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef RELATIONAL_STORE_DELEGATE_H 17 #define RELATIONAL_STORE_DELEGATE_H 18 19 #include <map> 20 21 #include "query.h" 22 #include "store_types.h" 23 #include "store_observer.h" 24 25 namespace DistributedDB { 26 class RelationalStoreDelegate { 27 public: 28 DB_API virtual ~RelationalStoreDelegate() = default; 29 30 struct Option { 31 StoreObserver *observer = nullptr; 32 // split mode 33 }; 34 35 DB_API virtual DBStatus CreateDistributedTable(const std::string &tableName) = 0; 36 37 DB_API virtual DBStatus Sync(const std::vector<std::string> &devices, SyncMode mode, 38 const Query &query, const SyncStatusCallback &onComplete, bool wait) = 0; 39 40 DB_API virtual DBStatus RemoveDeviceData(const std::string &device) = 0; 41 42 DB_API virtual DBStatus RemoveDeviceData(const std::string &device, const std::string &tableName) = 0; 43 }; 44 } // namespace DistributedDB 45 #endif // RELATIONAL_STORE_DELEGATE_H