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 DATASHARESERVICE_DATA_SHARE_OBS_PROXY_H 17 #define DATASHARESERVICE_DATA_SHARE_OBS_PROXY_H 18 19 #include "iremote_proxy.h" 20 #include "data_proxy_observer.h" 21 #include "datashare_template.h" 22 23 namespace OHOS::DataShare { 24 class RdbObserverProxy : public IRemoteProxy<IDataProxyRdbObserver> { 25 public: RdbObserverProxy(const sptr<IRemoteObject> & remote)26 explicit RdbObserverProxy(const sptr<IRemoteObject>& remote) : IRemoteProxy<IDataProxyRdbObserver>(remote) {} ~RdbObserverProxy()27 virtual ~RdbObserverProxy() {} 28 void OnChangeFromRdb(RdbChangeNode &changeNode) override; 29 30 private: 31 static inline BrokerDelegator<RdbObserverProxy> delegator_; 32 }; 33 34 class PublishedDataObserverProxy : public IRemoteProxy<IDataProxyPublishedDataObserver> { 35 public: PublishedDataObserverProxy(const sptr<IRemoteObject> & remote)36 explicit PublishedDataObserverProxy(const sptr<IRemoteObject>& remote) 37 : IRemoteProxy<IDataProxyPublishedDataObserver>(remote) {} ~PublishedDataObserverProxy()38 virtual ~PublishedDataObserverProxy() {} 39 void OnChangeFromPublishedData(PublishedDataChangeNode &changeNode) override; 40 41 private: 42 static inline BrokerDelegator<PublishedDataObserverProxy> delegator_; 43 }; 44 } // namespace OHOS::DataShare 45 #endif // DATA_SHARE_OBS_PROXY_H 46