blob: a04ab130cf5b9dc4a0b0fed34920ad21d68f9193 [file] [log] [blame]
Honghai Zhangcc411c02016-03-30 00:27:211/*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Steve Anton10542f22019-01-11 17:11:0011#ifndef P2P_BASE_CANDIDATE_PAIR_INTERFACE_H_
12#define P2P_BASE_CANDIDATE_PAIR_INTERFACE_H_
Honghai Zhangcc411c02016-03-30 00:27:2113
14namespace cricket {
15
16class Candidate;
17
18class CandidatePairInterface {
19 public:
20 virtual ~CandidatePairInterface() {}
21
22 virtual const Candidate& local_candidate() const = 0;
23 virtual const Candidate& remote_candidate() const = 0;
Honghai Zhangcc411c02016-03-30 00:27:2124};
25
Harald Alvestrand9a953b22024-01-26 07:11:5026// Specific implementation of the interface, suitable for being a
27// data member of other structs.
28struct CandidatePair final : public CandidatePairInterface {
29 ~CandidatePair() override = default;
30
31 const Candidate& local_candidate() const override { return local; }
32 const Candidate& remote_candidate() const override { return remote; }
33
34 Candidate local;
35 Candidate remote;
36};
37
Honghai Zhangcc411c02016-03-30 00:27:2138} // namespace cricket
39
Steve Anton10542f22019-01-11 17:11:0040#endif // P2P_BASE_CANDIDATE_PAIR_INTERFACE_H_