From 882b03436d7b40a788f060e0d83a4027f86e73ef Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 13 Nov 2018 16:00:13 -0800 Subject: WIP: libpxx instead of libpq --- controller/PostgreSQL.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'controller/PostgreSQL.hpp') 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 + 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 _ready, _connected, _run; mutable volatile bool _waitNoticePrinted; + + friend class _MemberNotificationReceiver; + friend class _NetworkNotificationReceiver; }; } -- cgit v1.2.3