summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/DNSSD/Fake')
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp1
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h13
2 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
index 0ef8c74..d8e7acf 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
@@ -43,6 +43,7 @@ boost::shared_ptr<DNSSDResolveHostnameQuery> FakeDNSSDQuerier::createResolveHost
void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query) {
runningQueries.push_back(query);
+ allQueriesEverRun.push_back(query);
if (boost::shared_ptr<FakeDNSSDBrowseQuery> browseQuery = boost::dynamic_pointer_cast<FakeDNSSDBrowseQuery>(query)) {
foreach(const DNSSDServiceID& service, services) {
MainEventLoop::postEvent(boost::bind(boost::ref(browseQuery->onServiceAdded), service), shared_from_this());
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
index 7ff092d..ef7af02 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
@@ -54,6 +54,18 @@ namespace Swift {
void setBrowseError();
void setRegisterError();
+ public:
+ template<typename T>
+ std::vector< boost::shared_ptr<T> > getAllQueriesEverRun() const {
+ std::vector< boost::shared_ptr<T> > result;
+ foreach(const boost::shared_ptr<FakeDNSSDQuery>& query, allQueriesEverRun) {
+ if (boost::shared_ptr<T> resultQuery = boost::dynamic_pointer_cast<T>(query)) {
+ result.push_back(resultQuery);
+ }
+ }
+ return result;
+ }
+
private:
template<typename T>
std::vector< boost::shared_ptr<T> > getQueries() const {
@@ -69,6 +81,7 @@ namespace Swift {
private:
String domain;
std::list< boost::shared_ptr<FakeDNSSDQuery> > runningQueries;
+ std::list< boost::shared_ptr<FakeDNSSDQuery> > allQueriesEverRun;
std::set<DNSSDServiceID> services;
typedef std::map<DNSSDServiceID,DNSSDResolveServiceQuery::Result> ServiceInfoMap;
ServiceInfoMap serviceInfo;