diff options
Diffstat (limited to 'Swiften/LinkLocal/LinkLocalRoster.cpp')
-rw-r--r-- | Swiften/LinkLocal/LinkLocalRoster.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/LinkLocalRoster.cpp b/Swiften/LinkLocal/LinkLocalRoster.cpp new file mode 100644 index 0000000..6773d51 --- /dev/null +++ b/Swiften/LinkLocal/LinkLocalRoster.cpp @@ -0,0 +1,21 @@ +#include <boost/bind.hpp> +#include <iostream> + +#include "Swiften/LinkLocal/LinkLocalRoster.h" + +namespace Swift { + +LinkLocalRoster::LinkLocalRoster(boost::shared_ptr<DNSSDService> service) : dnsSDService(service) { + service->onServiceAdded.connect(boost::bind(&LinkLocalRoster::handleServiceAdded, this, _1)); + service->onServiceRemoved.connect(boost::bind(&LinkLocalRoster::handleServiceRemoved, this, _1)); +} + +void LinkLocalRoster::handleServiceAdded(const DNSSDService::DiscoveredService& service) { + std::cout << "Service added " << service.name << " " << service.type << " " << service.domain << std::endl; +} + +void LinkLocalRoster::handleServiceRemoved(const DNSSDService::DiscoveredService& service) { + std::cout << "Service removed " << service.name << " " << service.type << " " << service.domain << std::endl; +} + +} |