• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef DISCOVERY_DNSSD_PUBLIC_DNS_SD_SERVICE_H_
6 #define DISCOVERY_DNSSD_PUBLIC_DNS_SD_SERVICE_H_
7 
8 #include <functional>
9 #include <memory>
10 
11 #include "platform/base/error.h"
12 #include "platform/base/interface_info.h"
13 #include "platform/base/ip_address.h"
14 
15 namespace openscreen {
16 
17 struct IPEndpoint;
18 class TaskRunner;
19 
20 namespace discovery {
21 
22 struct Config;
23 class DnsSdPublisher;
24 class DnsSdQuerier;
25 class ReportingClient;
26 
27 // This class provides a wrapper around DnsSdQuerier and DnsSdPublisher to
28 // allow for an embedder-overridable factory method below.
29 class DnsSdService {
30  public:
31   virtual ~DnsSdService() = default;
32 
33   // Returns the DnsSdQuerier owned by this DnsSdService. If queries are not
34   // supported, returns nullptr.
35   virtual DnsSdQuerier* GetQuerier() = 0;
36 
37   // Returns the DnsSdPublisher owned by this DnsSdService. If publishing is not
38   // supported, returns nullptr.
39   virtual DnsSdPublisher* GetPublisher() = 0;
40 };
41 
42 }  // namespace discovery
43 }  // namespace openscreen
44 
45 #endif  // DISCOVERY_DNSSD_PUBLIC_DNS_SD_SERVICE_H_
46