aboutsummaryrefslogtreecommitdiff
path: root/osp/public/service_publisher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'osp/public/service_publisher.cc')
-rw-r--r--osp/public/service_publisher.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/osp/public/service_publisher.cc b/osp/public/service_publisher.cc
index 3a8e70b7..2268f2d1 100644
--- a/osp/public/service_publisher.cc
+++ b/osp/public/service_publisher.cc
@@ -7,26 +7,25 @@
namespace openscreen {
namespace osp {
-ServicePublisherError::ServicePublisherError() = default;
-ServicePublisherError::ServicePublisherError(Code error,
- const std::string& message)
- : error(error), message(message) {}
-ServicePublisherError::ServicePublisherError(
- const ServicePublisherError& other) = default;
-ServicePublisherError::~ServicePublisherError() = default;
-
-ServicePublisherError& ServicePublisherError::operator=(
- const ServicePublisherError& other) = default;
-
ServicePublisher::Metrics::Metrics() = default;
ServicePublisher::Metrics::~Metrics() = default;
ServicePublisher::Config::Config() = default;
ServicePublisher::Config::~Config() = default;
+bool ServicePublisher::Config::IsValid() const {
+ return !friendly_name.empty() && !service_instance_name.empty() &&
+ connection_server_port > 0 && !network_interfaces.empty();
+}
+
+ServicePublisher::~ServicePublisher() = default;
+
+void ServicePublisher::SetConfig(const Config& config) {
+ config_ = config;
+}
+
ServicePublisher::ServicePublisher(Observer* observer)
: state_(State::kStopped), observer_(observer) {}
-ServicePublisher::~ServicePublisher() = default;
} // namespace osp
} // namespace openscreen