summaryrefslogtreecommitdiffstats
blob: df70506dc6bf566b519ef0a94a66af9d72eada5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "Swiften/LinkLocal/PlatformDNSSDServiceFactory.h"

#include <cassert>

#ifdef HAVE_SWIFTEN_CONFIG_H
#include "Swiften/config.h"
#endif
#if defined(HAVE_AVAHI)
#include "Swiften/LinkLocal/AvahiDNSSDService.h"
#elif defined(HAVE_BONJOUR)
#include "Swiften/LinkLocal/AppleDNSSDService.h"
#endif

namespace Swift {

PlatformDNSSDServiceFactory::PlatformDNSSDServiceFactory() {
}

bool PlatformDNSSDServiceFactory::canCreate() const {
#if defined(HAVE_AVAHI) || defined(HAVE_BONJOUR)
	return true;
#else
	return false;
#endif
}

boost::shared_ptr<DNSSDService> PlatformDNSSDServiceFactory::createDNSSDService() {
#if defined(HAVE_AVAHI)
	return boost::shared_ptr<DNSSDService>(new AvahiDNSSDService());
#elif defined(HAVE_BONJOUR)
  return boost::shared_ptr<DNSSDService>(new AppleDNSSDService());
#else
	assert(false);
	return boost::shared_ptr<DNSSDService>();
#endif
}

}