From 3f0e7d405f128e9faeea03cb6f97f25423983e63 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Thu, 29 Mar 2018 18:42:39 -0700 Subject: lib: adding device_addr_t constructor from map Adding constructor for device_addr_t that takes a map as an argument. --- host/lib/types/device_addr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/lib') diff --git a/host/lib/types/device_addr.cpp b/host/lib/types/device_addr.cpp index 18376a8b8..65d265857 100644 --- a/host/lib/types/device_addr.cpp +++ b/host/lib/types/device_addr.cpp @@ -41,6 +41,12 @@ device_addr_t::device_addr_t(const std::string &args){ } } +device_addr_t::device_addr_t(const std::map &info) { + for (auto& t : info) { + this->set(t.first, t.second); + } +} + std::string device_addr_t::to_pp_string(void) const{ if (this->size() == 0) return "Empty Device Address"; -- cgit v1.2.3