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