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 #include "osp/public/service_publisher.h" 6 7 namespace openscreen { 8 namespace osp { 9 10 ServicePublisher::Metrics::Metrics() = default; 11 ServicePublisher::Metrics::~Metrics() = default; 12 13 ServicePublisher::Config::Config() = default; 14 ServicePublisher::Config::~Config() = default; 15 IsValid() const16bool ServicePublisher::Config::IsValid() const { 17 return !friendly_name.empty() && !service_instance_name.empty() && 18 connection_server_port > 0 && !network_interfaces.empty(); 19 } 20 21 ServicePublisher::~ServicePublisher() = default; 22 SetConfig(const Config & config)23void ServicePublisher::SetConfig(const Config& config) { 24 config_ = config; 25 } 26 ServicePublisher(Observer * observer)27ServicePublisher::ServicePublisher(Observer* observer) 28 : state_(State::kStopped), observer_(observer) {} 29 30 } // namespace osp 31 } // namespace openscreen 32