|
| 1 | +// Copyright 2019 Google LLC |
| 2 | +// |
| 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 | +#ifndef FIREBASE_DATABASE_CLIENT_CPP_SRC_DESKTOP_CORE_INFO_LISTEN_PROVIDER_H_ |
| 16 | +#define FIREBASE_DATABASE_CLIENT_CPP_SRC_DESKTOP_CORE_INFO_LISTEN_PROVIDER_H_ |
| 17 | + |
| 18 | +#include "database/src/common/query_spec.h" |
| 19 | +#include "database/src/desktop/connection/persistent_connection.h" |
| 20 | +#include "database/src/desktop/core/listen_provider.h" |
| 21 | +#include "database/src/desktop/core/repo.h" |
| 22 | + |
| 23 | +namespace firebase { |
| 24 | +namespace database { |
| 25 | +namespace internal { |
| 26 | + |
| 27 | +class InfoListenProvider : public ListenProvider { |
| 28 | + public: |
| 29 | + InfoListenProvider(Repo* repo, Variant* info_data) |
| 30 | + : repo_(repo), info_data_(info_data), sync_tree_(nullptr) {} |
| 31 | + |
| 32 | + ~InfoListenProvider() override {} |
| 33 | + |
| 34 | + void set_sync_tree(SyncTree* sync_tree) { sync_tree_ = sync_tree; } |
| 35 | + |
| 36 | + void StartListening(const QuerySpec& query_spec, const View* view) override; |
| 37 | + |
| 38 | + void StopListening(const QuerySpec& query_spec) override; |
| 39 | + |
| 40 | + private: |
| 41 | + Repo* repo_; |
| 42 | + Variant* info_data_; |
| 43 | + SyncTree* sync_tree_; |
| 44 | +}; |
| 45 | + |
| 46 | +} // namespace internal |
| 47 | +} // namespace database |
| 48 | +} // namespace firebase |
| 49 | + |
| 50 | +#endif // FIREBASE_DATABASE_CLIENT_CPP_SRC_DESKTOP_CORE_INFO_LISTEN_PROVIDER_H_ |
0 commit comments