153c3577eSopenharmony_ci/*
253c3577eSopenharmony_ci* Copyright (c) 2023 Huawei Device Co., Ltd.
353c3577eSopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License");
453c3577eSopenharmony_ci* you may not use this file except in compliance with the License.
553c3577eSopenharmony_ci* You may obtain a copy of the License at
653c3577eSopenharmony_ci*
753c3577eSopenharmony_ci*     http://www.apache.org/licenses/LICENSE-2.0
853c3577eSopenharmony_ci*
953c3577eSopenharmony_ci* Unless required by applicable law or agreed to in writing, software
1053c3577eSopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS,
1153c3577eSopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1253c3577eSopenharmony_ci* See the License for the specific language governing permissions and
1353c3577eSopenharmony_ci* limitations under the License.
1453c3577eSopenharmony_ci*/
1553c3577eSopenharmony_ci
1653c3577eSopenharmony_ci#ifndef DISTRIBUTEDDATAMGR_OBJECT_SNAPSHOT_H
1753c3577eSopenharmony_ci#define DISTRIBUTEDDATAMGR_OBJECT_SNAPSHOT_H
1853c3577eSopenharmony_ci
1953c3577eSopenharmony_ci#include "object_asset_machine.h"
2053c3577eSopenharmony_ci#include "snapshot/snapshot.h"
2153c3577eSopenharmony_ci#include "store/general_value.h"
2253c3577eSopenharmony_cinamespace OHOS {
2353c3577eSopenharmony_cinamespace DistributedObject {
2453c3577eSopenharmony_ciusing namespace DistributedData;
2553c3577eSopenharmony_ciclass ObjectSnapshot : public Snapshot {
2653c3577eSopenharmony_cipublic:
2753c3577eSopenharmony_ci    ObjectSnapshot();
2853c3577eSopenharmony_ci    ~ObjectSnapshot() override;
2953c3577eSopenharmony_ci
3053c3577eSopenharmony_ci    int32_t Upload(Asset& asset) override;
3153c3577eSopenharmony_ci    int32_t Download(Asset& asset) override;
3253c3577eSopenharmony_ci    TransferStatus GetAssetStatus(Asset& asset) override;
3353c3577eSopenharmony_ci    int32_t Uploaded(Asset& asset) override;
3453c3577eSopenharmony_ci    int32_t Downloaded(Asset& asset) override;
3553c3577eSopenharmony_ci    int32_t Transferred(Asset& asset) override;
3653c3577eSopenharmony_ci    int32_t OnDataChanged(Asset& asset, const std::string& deviceId) override;
3753c3577eSopenharmony_ci    int32_t BindAsset(const Asset& asset, const DistributedData::AssetBindInfo& bindInfo,
3853c3577eSopenharmony_ci        const StoreInfo& storeInfo) override;
3953c3577eSopenharmony_ci    bool IsBoundAsset(const Asset& asset) override;
4053c3577eSopenharmony_ci
4153c3577eSopenharmony_ciprivate:
4253c3577eSopenharmony_ci    std::map<std::string, ChangedAssetInfo> changedAssets_;
4353c3577eSopenharmony_ci    std::shared_ptr<ObjectAssetMachine> assetMachine_;
4453c3577eSopenharmony_ci};
4553c3577eSopenharmony_ci} // namespace DistributedObject
4653c3577eSopenharmony_ci} // namespace OHOS
4753c3577eSopenharmony_ci#endif // DISTRIBUTEDDATAMGR_OBJECT_SNAPSHOT_H
48