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 OHOS_DISTRIBUTED_DATA_KV_STORE_FRAMEWORKS_INNERKITSIMPL_RDB_RDB_NOTIFIER_PROXY_H 17 #define OHOS_DISTRIBUTED_DATA_KV_STORE_FRAMEWORKS_INNERKITSIMPL_RDB_RDB_NOTIFIER_PROXY_H 18 #include <iremote_broker.h> 19 #include <iremote_proxy.h> 20 21 #include "rdb_notifier.h" 22 namespace OHOS::DistributedRdb { 23 class RdbNotifierProxyBroker : public IRdbNotifier, public IRemoteBroker { 24 public: 25 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.DistributedRdb.IRdbNotifier"); 26 }; 27 28 class RdbNotifierProxy : public IRemoteProxy<RdbNotifierProxyBroker> { 29 public: 30 explicit RdbNotifierProxy(const sptr<IRemoteObject>& object); 31 virtual ~RdbNotifierProxy() noexcept; 32 33 int32_t OnComplete(uint32_t seqNum, Details &&result) override; 34 35 int32_t OnComplete(const std::string& storeName, Details &&result) override; 36 37 int32_t OnChange(const Origin &origin, const PrimaryFields &primaries, ChangeInfo &&changeInfo) override; 38 39 private: 40 static inline BrokerDelegator<RdbNotifierProxy> delegator_; 41 }; 42 } // namespace OHOS::DistributedRdb 43 #endif // OHOS_DISTRIBUTED_DATA_KV_STORE_FRAMEWORKS_INNERKITSIMPL_RDB_RDB_NOTIFIER_PROXY_H 44