tests: investigating catch2
[awesomized/libmemcached] / testing / lib / WaitForConn.hpp
1 #pragma once
2
3 #include "Poll.hpp"
4
5 #include <netinet/in.h>
6 #include <sys/poll.h>
7
8 #include <tuple>
9 #include <vector>
10
11 using namespace std;
12
13 class WaitForConn {
14 public:
15 using conn_t = tuple<int, sockaddr_storage, unsigned int>;
16
17 private:
18 vector<conn_t> conns;
19 Poll poll;
20
21 public:
22 explicit
23 WaitForConn(vector<conn_t> &&conns_, Poll &&poll_ = Poll{POLLOUT})
24 : conns{conns_}
25 , poll{poll_}
26 { }
27
28 static bool connect(const conn_t &conn);
29
30 bool operator () ();
31 };