From 5f7bd068d0fc26dff68f1fc554fbdcd253db5a8e Mon Sep 17 00:00:00 2001 From: Sergey Linev <S.Linev@gsi.de> Date: Fri, 24 Aug 2018 16:44:34 +0200 Subject: [PATCH] http: use override and remove virtual keywords --- net/http/src/TCivetweb.cxx | 14 +++++++------- net/http/src/THttpLongPollEngine.h | 14 +++++++------- net/http/src/THttpWSEngine.h | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/net/http/src/TCivetweb.cxx b/net/http/src/TCivetweb.cxx index 70596443da7..6a1c2ff5cbf 100644 --- a/net/http/src/TCivetweb.cxx +++ b/net/http/src/TCivetweb.cxx @@ -33,23 +33,23 @@ protected: struct mg_connection *fWSconn; /// True websocket requires extra thread to parallelize sending - virtual Bool_t SupportSendThrd() const { return kTRUE; } + Bool_t SupportSendThrd() const override { return kTRUE; } public: TCivetwebWSEngine(struct mg_connection *conn) : THttpWSEngine(), fWSconn(conn) {} - virtual ~TCivetwebWSEngine() {} + virtual ~TCivetwebWSEngine() = default; - virtual UInt_t GetId() const { return TString::Hash((void *)&fWSconn, sizeof(void *)); } + UInt_t GetId() const override { return TString::Hash((void *)&fWSconn, sizeof(void *)); } - virtual void ClearHandle(Bool_t terminate) override + void ClearHandle(Bool_t terminate) override { if (fWSconn && terminate) mg_websocket_write(fWSconn, MG_WEBSOCKET_OPCODE_CONNECTION_CLOSE, nullptr, 0); fWSconn = nullptr; } - virtual void Send(const void *buf, int len) + void Send(const void *buf, int len) override { if (fWSconn) mg_websocket_write(fWSconn, MG_WEBSOCKET_OPCODE_BINARY, (const char *)buf, len); @@ -59,7 +59,7 @@ public: /// Special method to send binary data with text header /// For normal websocket it is two separated operation, for other engines could be combined together, /// but emulates as two messages on client side - virtual void SendHeader(const char *hdr, const void *buf, int len) + void SendHeader(const char *hdr, const void *buf, int len) override { if (fWSconn) { mg_websocket_write(fWSconn, MG_WEBSOCKET_OPCODE_TEXT, hdr, strlen(hdr)); @@ -67,7 +67,7 @@ public: } } - virtual void SendCharStar(const char *str) + void SendCharStar(const char *str) override { if (fWSconn) mg_websocket_write(fWSconn, MG_WEBSOCKET_OPCODE_TEXT, str, strlen(str)); diff --git a/net/http/src/THttpLongPollEngine.h b/net/http/src/THttpLongPollEngine.h index 6e521161c1a..1a01c3152fb 100644 --- a/net/http/src/THttpLongPollEngine.h +++ b/net/http/src/THttpLongPollEngine.h @@ -38,19 +38,19 @@ public: THttpLongPollEngine(bool raw = false); virtual ~THttpLongPollEngine(); - virtual UInt_t GetId() const override; + UInt_t GetId() const override; - virtual void ClearHandle(Bool_t) override; + void ClearHandle(Bool_t) override; - virtual void Send(const void *buf, int len) override; + void Send(const void *buf, int len) override; - virtual void SendCharStar(const char *buf) override; + void SendCharStar(const char *buf) override; - virtual void SendHeader(const char *hdr, const void *buf, int len) override; + void SendHeader(const char *hdr, const void *buf, int len) override; - virtual Bool_t PreProcess(std::shared_ptr<THttpCallArg> &arg) override; + Bool_t PreProcess(std::shared_ptr<THttpCallArg> &arg) override; - virtual void PostProcess(std::shared_ptr<THttpCallArg> &arg) override; + void PostProcess(std::shared_ptr<THttpCallArg> &arg) override; }; #endif diff --git a/net/http/src/THttpWSEngine.h b/net/http/src/THttpWSEngine.h index 609a7371f4c..95f28ad6a7c 100644 --- a/net/http/src/THttpWSEngine.h +++ b/net/http/src/THttpWSEngine.h @@ -33,10 +33,10 @@ private: std::thread fSendThrd; ///<! dedicated thread for all send operations bool fHasSendThrd{false}; ///<! if any special thread was started - std::mutex fCondMutex; ///<! mutex used to access acondition + std::mutex fCondMutex; ///<! mutex used to access condition std::condition_variable fCond; ///<! condition used to sync with sending thread - std::mutex fDataMutex; ///<! protects data submited for send operation + std::mutex fDataMutex; ///<! protects data submitted for send operation enum { kNone, kData, kHeader, kText } fKind{kNone}; ///<! kind of operation bool fDoingSend{false}; ///<! doing send operation in other thread std::string fData; ///<! data (binary or text) -- GitLab