• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 UDMF_SERVICE_IMPL_H
17 #define UDMF_SERVICE_IMPL_H
18 
19 #include <vector>
20 
21 #include "udmf_service_stub.h"
22 
23 namespace OHOS {
24 namespace UDMF {
25 /*
26  * UDMF server implementation
27  */
28 class UdmfServiceImpl final : public UdmfServiceStub {
29 public:
30     UdmfServiceImpl() = default;
31     ~UdmfServiceImpl() = default;
32 
33     int32_t SetData(CustomOption &option, UnifiedData &unifiedData, std::string &key) override;
34     int32_t GetData(const QueryOption &query, UnifiedData &unifiedData) override;
35     int32_t GetBatchData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet) override;
36     int32_t UpdateData(const QueryOption &query, UnifiedData &unifiedData) override;
37     int32_t DeleteData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet) override;
38     int32_t GetSummary(const QueryOption &query, Summary &summary) override;
39     int32_t AddPrivilege(const QueryOption &query, Privilege &privilege) override;
40     int32_t Sync(const QueryOption &query, const std::vector<std::string> &devices) override;
41     int32_t OnInitialize() override;
42 
43 private:
44     class Factory {
45     public:
46         Factory();
47         ~Factory();
48 
49     private:
50         std::shared_ptr<UdmfServiceImpl> product_;
51     };
52     static Factory factory_;
53 };
54 } // namespace UDMF
55 } // namespace OHOS
56 #endif // UDMF_SERVICE_IMPL_H
57