aboutsummaryrefslogtreecommitdiff
path: root/src/common/dns_utils.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-27 21:06:09 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-27 21:06:09 +0100
commit5990344cb07858b4cd104eacb8d1b9bb38fa6ff7 (patch)
treee4125cca97cd3f34e8fadf1111513c78ac168730 /src/common/dns_utils.h
parentMerge pull request #390 (diff)
downloadmonero-5990344cb07858b4cd104eacb8d1b9bb38fa6ff7.tar.xz
dns: make ctor private
This ensures one can't instanciate a DNSResolver object by mistake, but uses the singleton. A separate create static function is added for cases where a new object is explicitely needed.
Diffstat (limited to 'src/common/dns_utils.h')
-rw-r--r--src/common/dns_utils.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h
index 1e726c80c..50e8001f1 100644
--- a/src/common/dns_utils.h
+++ b/src/common/dns_utils.h
@@ -49,7 +49,7 @@ struct DNSResolverData;
*/
class DNSResolver
{
-public:
+private:
/**
* @brief Constructs an instance of DNSResolver
@@ -58,6 +58,8 @@ public:
*/
DNSResolver();
+public:
+
/**
* @brief takes care of freeing C pointers and such
*/
@@ -119,6 +121,13 @@ public:
*/
static DNSResolver& instance();
+ /**
+ * @brief Gets a new instance of DNSResolver
+ *
+ * @return returns a pointer to the new object
+ */
+ static DNSResolver create();
+
private:
/**