1 /*
2  * Copyright (c) 2023 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 OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_SNAPSHOT_H
17 #define OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_SNAPSHOT_H
18 #include "machine_status.h"
19 #include "store/general_value.h"
20 #include "store/store_info.h"
21 #include "visibility.h"
22 namespace OHOS {
23 namespace DistributedData {
24 
25 class API_EXPORT Snapshot {
26 public:
27     virtual ~Snapshot() = default;
28 
29     virtual int32_t Transferred(Asset& asset) = 0;
30 
31     virtual int32_t Upload(Asset& asset) = 0;
32 
33     virtual int32_t Download(Asset& asset) = 0;
34 
35     virtual int32_t Uploaded(Asset& asset) = 0;
36 
37     virtual int32_t Downloaded(Asset& asset) = 0;
38 
39     virtual TransferStatus GetAssetStatus(Asset& asset) = 0;
40 
41     virtual int32_t BindAsset(const Asset& asset, const AssetBindInfo& bindInfo, const StoreInfo& storeInfo) = 0;
42 
43     virtual int32_t OnDataChanged(Asset& asset, const std::string &deviceId) = 0;
44 
45     virtual bool IsBoundAsset(const Asset& asset) = 0;
46 
47 };
48 
49 struct BindAssets {
50     std::shared_ptr<std::map<std::string, std::shared_ptr<Snapshot>>> bindAssets;
51 };
52 } // namespace DistributedData
53 } // namespace OHOS
54 #endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_SNAPSHOT_SNAPSHOT_H
55