From: Michal Jarzabek Date: Fri, 18 Dec 2015 19:26:45 +0000 (+0000) Subject: msg/Connection::add override to virutal methods X-Git-Tag: v10.0.3~151^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=277b353e92487538e683b920e35b5ceb085dcf56;p=ceph.git msg/Connection::add override to virutal methods Signed-off-by: Michal Jarzabek --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index cbf37c2f8780..f5cda2a84e4b 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3088,19 +3088,19 @@ void Monitor::forward_request_leader(MonOpRequestRef op) struct AnonConnection : public Connection { AnonConnection(CephContext *cct) : Connection(cct, NULL) {} - int send_message(Message *m) { + int send_message(Message *m) override { assert(!"send_message on anonymous connection"); } - void send_keepalive() { + void send_keepalive() override { assert(!"send_keepalive on anonymous connection"); } - void mark_down() { + void mark_down() override { // silently ignore } - void mark_disposable() { + void mark_disposable() override { // silengtly ignore } - bool is_connected() { return false; } + bool is_connected() override { return false; } }; //extract the original message and put it into the regular dispatch function diff --git a/src/msg/async/AsyncConnection.h b/src/msg/async/AsyncConnection.h index c578a7a43584..9bf9a11223c3 100644 --- a/src/msg/async/AsyncConnection.h +++ b/src/msg/async/AsyncConnection.h @@ -122,7 +122,7 @@ class AsyncConnection : public Connection { ostream& _conn_prefix(std::ostream *_dout); - bool is_connected() { + bool is_connected() override { Mutex::Locker l(lock); return state >= STATE_OPEN && state <= STATE_OPEN_TAG_CLOSE; } @@ -136,11 +136,11 @@ class AsyncConnection : public Connection { } // Only call when AsyncConnection first construct void accept(int sd); - int send_message(Message *m); + int send_message(Message *m) override; - void send_keepalive(); - void mark_down(); - void mark_disposable() { + void send_keepalive() override; + void mark_down() override; + void mark_disposable() override { Mutex::Locker l(lock); policy.lossy = true; } diff --git a/src/msg/simple/PipeConnection.h b/src/msg/simple/PipeConnection.h index 9e27ec4a58dd..7a8e9d0a65a1 100644 --- a/src/msg/simple/PipeConnection.h +++ b/src/msg/simple/PipeConnection.h @@ -41,12 +41,12 @@ public: void reset_pipe(Pipe* p); - bool is_connected(); + bool is_connected() override; - int send_message(Message *m); - void send_keepalive(); - void mark_down(); - void mark_disposable(); + int send_message(Message *m) override; + void send_keepalive() override; + void mark_down() override; + void mark_disposable() override; }; /* PipeConnection */ diff --git a/src/msg/xio/XioConnection.h b/src/msg/xio/XioConnection.h index 9a5f615893a5..da34d6e5520f 100644 --- a/src/msg/xio/XioConnection.h +++ b/src/msg/xio/XioConnection.h @@ -259,14 +259,14 @@ public: xio_connection_destroy(conn); } - bool is_connected() { return connected.read(); } + bool is_connected() override { return connected.read(); } - int send_message(Message *m); - void send_keepalive() {} - virtual void mark_down(); + int send_message(Message *m) override; + void send_keepalive() override {} + void mark_down() override; int _mark_down(uint32_t flags); - virtual void mark_disposable(); - int _mark_disposable(uint32_t flags); + virtual void mark_disposable() override; + int _mark_disposable(uint32_t flags) override; const entity_inst_t& get_peer() const { return peer; } @@ -334,12 +334,12 @@ public: return static_cast(RefCountedObject::get()); } - virtual bool is_connected() { return true; } + bool is_connected() override { return true; } - int send_message(Message *m); - void send_keepalive() {} - void mark_down() {} - void mark_disposable() {} + int send_message(Message *m) override; + void send_keepalive()i override {} + void mark_down() override {} + void mark_disposable() override {} uint32_t get_seq() { return seq.read();