blob: 08b60859c04e33d39be6b2a9a517f9032eca0611 [file] [log] [blame]
Yingdi Yuf3401182015-02-02 20:21:07 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 *
5 * BSD license, See the LICENSE file for more information
6 *
7 * Author: Qiuhan Ding <qiuhanding@cs.ucla.edu>
8 */
9
10#ifndef CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP
11#define CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP
12
13#include <QThread>
14
15#ifndef Q_MOC_RUN
16#include "common.hpp"
17#include <mutex>
18#include <boost/thread.hpp>
19#include <ndn-cxx/face.hpp>
20#endif
21
22namespace chronochat {
23
24class NfdConnectionChecker : public QThread
25{
26 Q_OBJECT
27
28public:
29 NfdConnectionChecker(QObject* parent = nullptr);
30
31protected:
32 void
33 run();
34
35signals:
36 void
37 nfdConnected();
38
39public slots:
40 void
41 shutdown();
42
43private:
44 bool m_nfdConnected;
45 std::mutex m_nfdMutex;
46
47 unique_ptr<ndn::Face> m_face;
48};
49
50} // namespace chronochat
51
52#endif // CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP