1 // Copyright 2018 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 OSP_IMPL_RECEIVER_LIST_H_
6 #define OSP_IMPL_RECEIVER_LIST_H_
7 
8 #include <vector>
9 
10 #include "osp/public/service_info.h"
11 #include "platform/base/error.h"
12 
13 namespace openscreen {
14 namespace osp {
15 
16 class ReceiverList {
17  public:
18   ReceiverList();
19   ~ReceiverList();
20   ReceiverList(ReceiverList&&) = delete;
21   ReceiverList& operator=(ReceiverList&&) = delete;
22 
23   void OnReceiverAdded(const ServiceInfo& info);
24 
25   Error OnReceiverChanged(const ServiceInfo& info);
26   Error OnReceiverRemoved(const ServiceInfo& info);
27   Error OnAllReceiversRemoved();
28 
receivers()29   const std::vector<ServiceInfo>& receivers() const { return receivers_; }
30 
31  private:
32   std::vector<ServiceInfo> receivers_;
33 };
34 
35 }  // namespace osp
36 }  // namespace openscreen
37 
38 #endif  // OSP_IMPL_RECEIVER_LIST_H_
39