blob: 75784f7a1e6c635900d9b7b08c9b03fbe3f6bd81 [file] [log] [blame]
Yingdi Yuf3401182015-02-02 20:21:07 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
Varun Patila24bd3e2020-11-24 10:08:33 +05303 * Copyright (c) 2020, Regents of the University of California
Yingdi Yuf3401182015-02-02 20:21:07 -08004 *
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
Yingdi Yuf3401182015-02-02 20:21:07 -080013#include "common.hpp"
Varun Patila24bd3e2020-11-24 10:08:33 +053014
15#include <QThread>
Yingdi Yuf3401182015-02-02 20:21:07 -080016#include <mutex>
17#include <boost/thread.hpp>
18#include <ndn-cxx/face.hpp>
Yingdi Yuf3401182015-02-02 20:21:07 -080019
20namespace chronochat {
21
22class NfdConnectionChecker : public QThread
23{
24 Q_OBJECT
25
26public:
27 NfdConnectionChecker(QObject* parent = nullptr);
28
29protected:
30 void
31 run();
32
33signals:
34 void
35 nfdConnected();
36
37public slots:
38 void
39 shutdown();
40
41private:
42 bool m_nfdConnected;
43 std::mutex m_nfdMutex;
44
45 unique_ptr<ndn::Face> m_face;
46};
47
48} // namespace chronochat
49
50#endif // CHRONOCHAT_NFD_CONNECTION_CHECKER_HPP