qnode.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef %(package)s_QNODE_HPP_
13 #define %(package)s_QNODE_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
19 // To workaround boost/qt4 problems that won't be bugfixed. Refer to
20 // https://bugreports.qt.io/browse/QTBUG-22829
21 #ifndef Q_MOC_RUN
22 #include <ros/ros.h>
23 #endif
24 #include <string>
25 #include <QThread>
26 #include <QStringListModel>
27 
28 
29 /*****************************************************************************
30 ** Namespaces
31 *****************************************************************************/
32 
33 namespace %(package)s {
34 
35 /*****************************************************************************
36 ** Class
37 *****************************************************************************/
38 
39 class QNode : public QThread {
40  Q_OBJECT
41 public:
42  QNode(int argc, char** argv );
43  virtual ~QNode();
44  bool init();
45  bool init(const std::string &master_url, const std::string &host_url);
46  void run();
47 
48  /*********************
49  ** Logging
50  **********************/
51  enum LogLevel {
56  Fatal
57  };
58 
59  QStringListModel* loggingModel() { return &logging_model; }
60  void log( const LogLevel &level, const std::string &msg);
61 
62 Q_SIGNALS:
63  void loggingUpdated();
64  void rosShutdown();
65 
66 private:
67  int init_argc;
68  char** init_argv;
69  ros::Publisher chatter_publisher;
70  QStringListModel logging_model;
71 };
72 
73 } // namespace %(package)s
74 
75 #endif /* %(package)s_QNODE_HPP_ */
char ** init_argv
Definition: qnode.hpp:68
QStringListModel logging_model
Definition: qnode.hpp:70
int init_argc
Definition: qnode.hpp:67
#define package
Definition: qnode.hpp:13
ros::Publisher chatter_publisher
Definition: qnode.hpp:69
QStringListModel * loggingModel()
Definition: qnode.hpp:59
LogLevel
Definition: qnode.hpp:51


qt_create
Author(s): Daniel Stonier
autogenerated on Wed Mar 11 2020 03:12:19