summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalServiceBrowser.h')
-rw-r--r--Swiften/LinkLocal/LinkLocalServiceBrowser.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/LinkLocalServiceBrowser.h b/Swiften/LinkLocal/LinkLocalServiceBrowser.h
new file mode 100644
index 0000000..c0788e6
--- /dev/null
+++ b/Swiften/LinkLocal/LinkLocalServiceBrowser.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <map>
+#include <vector>
+
+#include "Swiften/Base/String.h"
+#include "Swiften/LinkLocal/DNSSDService.h"
+#include "Swiften/LinkLocal/LinkLocalService.h"
+
+namespace Swift {
+ class HostAddress;
+
+ class LinkLocalServiceBrowser {
+ public:
+ LinkLocalServiceBrowser(boost::shared_ptr<DNSSDService> service);
+
+ boost::signal<void (const LinkLocalServiceID&)> onServiceAdded;
+ boost::signal<void (const LinkLocalServiceID&)> onServiceChanged;
+
+ private:
+ void handleServiceAdded(const LinkLocalServiceID&);
+ void handleServiceRemoved(const LinkLocalServiceID&);
+ void handleServiceResolved(const LinkLocalServiceID& service, const DNSSDService::ResolveResult& result);
+
+ private:
+ boost::shared_ptr<DNSSDService> dnsSDService;
+ typedef std::map<LinkLocalServiceID, DNSSDService::ResolveResult> ServiceMap;
+ ServiceMap services;
+ };
+}