I'm looking at an example header file for Qt WebSockets and I'm a beginner with C++ and I'm trying to figure out what exactly the #define is doing.
I understand that #define acts to define a global variable but I'm unsure what this variable ECHOCLIENT_H is actually doing. It isn't in the subsequent main function or anywhere else. What is it's function?
#ifndef ECHOCLIENT_H
#define ECHOCLIENT_H
#include <QtCore/QObject>
#include <QtWebSockets/QWebSocket>
class EchoClient : public QObject
{
Q_OBJECT
public:
explicit EchoClient(const QUrl &url, bool debug = false, QObject *parent = nullptr);
Q_SIGNALS:
void closed();
private Q_SLOTS:
void onConnected();
void onTextMessageReceived(QString message);
private:
QWebSocket m_webSocket;
QUrl m_url;
bool m_debug;
};
#endif // ECHOCLIENT_H