summaryrefslogtreecommitdiff
path: root/controller/PostgreSQL.hpp
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2018-11-13 16:00:13 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2018-11-13 16:00:13 -0800
commit882b03436d7b40a788f060e0d83a4027f86e73ef (patch)
treeed637bd8cc3cec107b50fea483940093122b6af5 /controller/PostgreSQL.hpp
parent33d7b22abe3988b2682f4bdf87ce632cf6243ae6 (diff)
downloadinfinitytier-882b03436d7b40a788f060e0d83a4027f86e73ef.tar.gz
infinitytier-882b03436d7b40a788f060e0d83a4027f86e73ef.zip
WIP: libpxx instead of libpq
Diffstat (limited to 'controller/PostgreSQL.hpp')
-rw-r--r--controller/PostgreSQL.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/controller/PostgreSQL.hpp b/controller/PostgreSQL.hpp
index 36fe8c9f..86aac80d 100644
--- a/controller/PostgreSQL.hpp
+++ b/controller/PostgreSQL.hpp
@@ -23,12 +23,16 @@
#include "DB.hpp"
+#include <pqxx/pqxx>
+
extern "C" {
typedef struct pg_conn PGconn;
}
namespace ZeroTier
{
+class _MemberNotificationReceiver;
+class _NetworkNotificationReceiver;
/**
* A controller database driver that talks to PostgreSQL
@@ -56,8 +60,8 @@ protected:
};
private:
- void initializeNetworks(PGconn *conn);
- void initializeMembers(PGconn *conn);
+ void initializeNetworks(pqxx::connection &conn);
+ void initializeMembers(pqxx::connection &conn);
void heartbeat();
void membersDbWatcher();
void networksDbWatcher();
@@ -81,6 +85,9 @@ private:
mutable std::mutex _readyLock;
std::atomic<int> _ready, _connected, _run;
mutable volatile bool _waitNoticePrinted;
+
+ friend class _MemberNotificationReceiver;
+ friend class _NetworkNotificationReceiver;
};
}