• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #define LOG_TAG "AbstractType"
17 
18 #include "napi_abstract_type.h"
19 
20 #include "log_print.h"
21 
22 namespace OHOS::CollaborationEdit {
AbstractType()23 AbstractType::AbstractType()
24 {
25     this->adapter_ = std::make_shared<RdAdapter>();
26 }
27 
SetDBStore(std::shared_ptr<DBStore> dbStore)28 void AbstractType::SetDBStore(std::shared_ptr<DBStore> dbStore)
29 {
30     this->adapter_->SetDBStore(dbStore);
31 }
32 
GetDBStore()33 std::shared_ptr<DBStore> AbstractType::GetDBStore()
34 {
35     return this->adapter_->GetDBStore();
36 }
37 
SetTableName(std::string name)38 void AbstractType::SetTableName(std::string name)
39 {
40     this->adapter_->SetTableName(name);
41 }
42 
GetTableName()43 std::string AbstractType::GetTableName()
44 {
45     return this->adapter_->GetTableName();
46 }
47 
SetID(std::optional<ID> id)48 void AbstractType::SetID(std::optional<ID> id)
49 {
50     this->adapter_->SetID(id);
51 }
52 
GetID()53 std::optional<ID> AbstractType::GetID()
54 {
55     return this->adapter_->GetID();
56 }
57 
GetAdapter()58 std::shared_ptr<RdAdapter> AbstractType::GetAdapter()
59 {
60     return this->adapter_;
61 }
62 } // namespace OHOS::CollaborationEdit
63