summaryrefslogtreecommitdiffstats
path: root/fnet
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-04-03 22:46:03 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-04-04 16:36:18 +0200
commit37cfa9ab6b103ae733a783cde18c8384e0ace507 (patch)
tree99b4ec1964a7a392b4aec133c4b20a4a40ab0002 /fnet
parent5a48a81c4134bae524aa66e1e49624f678c8b6ce (diff)
Override
Diffstat (limited to 'fnet')
-rw-r--r--fnet/src/vespa/fnet/connection.cpp4
-rw-r--r--fnet/src/vespa/fnet/connection.h8
-rw-r--r--fnet/src/vespa/fnet/connector.h6
-rw-r--r--fnet/src/vespa/fnet/controlpacket.h24
-rw-r--r--fnet/src/vespa/fnet/dummypacket.h14
-rw-r--r--fnet/src/vespa/fnet/fdselector.h6
-rw-r--r--fnet/src/vespa/fnet/frt/invoker.h20
-rw-r--r--fnet/src/vespa/fnet/frt/packets.h36
-rw-r--r--fnet/src/vespa/fnet/frt/supervisor.h12
-rw-r--r--fnet/src/vespa/fnet/packetqueue.h8
-rw-r--r--fnet/src/vespa/fnet/transport_thread.cpp2
-rw-r--r--fnet/src/vespa/fnet/transport_thread.h4
12 files changed, 71 insertions, 73 deletions
diff --git a/fnet/src/vespa/fnet/connection.cpp b/fnet/src/vespa/fnet/connection.cpp
index beb7a16abbb..82f757a6027 100644
--- a/fnet/src/vespa/fnet/connection.cpp
+++ b/fnet/src/vespa/fnet/connection.cpp
@@ -26,7 +26,7 @@ public:
_done(false),
_waiting(false) {}
- virtual ~SyncPacket() {}
+ ~SyncPacket() {}
void WaitFree() {
_cond.Lock();
@@ -37,7 +37,7 @@ public:
_cond.Unlock();
}
- virtual void Free();
+ void Free() override;
};
diff --git a/fnet/src/vespa/fnet/connection.h b/fnet/src/vespa/fnet/connection.h
index 12b3c85b672..b84797624bf 100644
--- a/fnet/src/vespa/fnet/connection.h
+++ b/fnet/src/vespa/fnet/connection.h
@@ -442,14 +442,14 @@ public:
* destructed. Will invoke the Cleanup method on the cleanup handler
* for this connection, if present.
**/
- void CleanupHook();
+ void CleanupHook() override;
/**
* Close this connection immidiately. NOTE: this method should only
* be called by the transport thread.
**/
- void Close();
+ void Close() override;
/**
@@ -457,7 +457,7 @@ public:
*
* @return false if connection broken, true otherwise.
**/
- bool HandleReadEvent();
+ bool HandleReadEvent() override;
/**
@@ -465,7 +465,7 @@ public:
*
* @return false is connection broken, true otherwise.
**/
- bool HandleWriteEvent();
+ bool HandleWriteEvent() override;
/**
* @return Returns the size of this connection's output buffer.
diff --git a/fnet/src/vespa/fnet/connector.h b/fnet/src/vespa/fnet/connector.h
index 130e15cd318..7463397afa4 100644
--- a/fnet/src/vespa/fnet/connector.h
+++ b/fnet/src/vespa/fnet/connector.h
@@ -68,7 +68,7 @@ public:
* thread in order to avoid race conditions related to socket event
* registration, deregistration and triggering.
**/
- void Close();
+ void Close() override;
/**
* Called by the transport layer when a read event has occurred. If
@@ -77,7 +77,7 @@ public:
*
* @return false if connector is broken, true otherwise.
**/
- bool HandleReadEvent();
+ bool HandleReadEvent() override;
/**
* Called by the transport layer when a write event has
@@ -87,6 +87,6 @@ public:
*
* @return true.
**/
- bool HandleWriteEvent();
+ bool HandleWriteEvent() override;
};
diff --git a/fnet/src/vespa/fnet/controlpacket.h b/fnet/src/vespa/fnet/controlpacket.h
index 2ecbef8fcbf..f48bcaabfc2 100644
--- a/fnet/src/vespa/fnet/controlpacket.h
+++ b/fnet/src/vespa/fnet/controlpacket.h
@@ -62,42 +62,42 @@ public:
/**
* This method is empty.
**/
- virtual void Free();
+ void Free() override;
/**
* @return false
**/
- virtual bool IsRegularPacket();
+ bool IsRegularPacket() override;
/**
* @return true
**/
- virtual bool IsControlPacket();
+ bool IsControlPacket() override;
- virtual uint32_t GetCommand();
- virtual bool IsChannelLostCMD();
- virtual bool IsTimeoutCMD();
- virtual bool IsBadPacketCMD();
+ uint32_t GetCommand() override;
+ bool IsChannelLostCMD() override;
+ bool IsTimeoutCMD() override;
+ bool IsBadPacketCMD() override;
/**
* @return FNET_NOID
**/
- virtual uint32_t GetPCODE();
+ uint32_t GetPCODE() override;
/**
* @return 0
**/
- virtual uint32_t GetLength();
+ uint32_t GetLength() override;
/**
* This method should never be called and will abort the program.
**/
- virtual void Encode(FNET_DataBuffer *);
+ void Encode(FNET_DataBuffer *) override;
/**
* This method should never be called and will abort the program.
**/
- virtual bool Decode(FNET_DataBuffer *, uint32_t);
- virtual vespalib::string Print(uint32_t indent = 0);
+ bool Decode(FNET_DataBuffer *, uint32_t) override;
+ vespalib::string Print(uint32_t indent = 0) override;
};
diff --git a/fnet/src/vespa/fnet/dummypacket.h b/fnet/src/vespa/fnet/dummypacket.h
index 87af112901c..be0a932e77d 100644
--- a/fnet/src/vespa/fnet/dummypacket.h
+++ b/fnet/src/vespa/fnet/dummypacket.h
@@ -23,36 +23,36 @@ public:
/**
* @return false
**/
- virtual bool IsRegularPacket();
+ bool IsRegularPacket() override;
/**
* @return false
**/
- virtual bool IsControlPacket();
+ bool IsControlPacket() override;
/**
* @return FNET_NOID
**/
- virtual uint32_t GetPCODE();
+ uint32_t GetPCODE() override;
/**
* @return 0
**/
- virtual uint32_t GetLength();
+ uint32_t GetLength() override;
/**
* This method should never be called and will abort the program.
**/
- virtual void Encode(FNET_DataBuffer *);
+ void Encode(FNET_DataBuffer *) override;
/**
* This method should never be called and will abort the program.
**/
- virtual bool Decode(FNET_DataBuffer *, uint32_t);
+ bool Decode(FNET_DataBuffer *, uint32_t) override;
/**
* Identify as dummy packet.
**/
- virtual vespalib::string Print(uint32_t indent = 0);
+ vespalib::string Print(uint32_t indent = 0) override;
};
diff --git a/fnet/src/vespa/fnet/fdselector.h b/fnet/src/vespa/fnet/fdselector.h
index f7468039f0b..7dee084fae4 100644
--- a/fnet/src/vespa/fnet/fdselector.h
+++ b/fnet/src/vespa/fnet/fdselector.h
@@ -204,18 +204,18 @@ protected:
* io component. This method performs internal cleanup related to
* the io component framework used in FNET.
**/
- void Close();
+ void Close() override;
/**
* This method is called by the transport thread when the
* underlying file descriptor is ready for reading.
**/
- bool HandleReadEvent();
+ bool HandleReadEvent() override;
/**
* This method is called by the transport layer when the
* underlying file descriptor is ready for writing.
**/
- bool HandleWriteEvent();
+ bool HandleWriteEvent() override;
};
diff --git a/fnet/src/vespa/fnet/frt/invoker.h b/fnet/src/vespa/fnet/frt/invoker.h
index 60bc30312e3..9955ca12240 100644
--- a/fnet/src/vespa/fnet/frt/invoker.h
+++ b/fnet/src/vespa/fnet/frt/invoker.h
@@ -38,7 +38,7 @@ public:
virtual ~FRT_SingleReqWait();
void WaitReq();
- virtual void RequestDone(FRT_RPCRequest *req);
+ void RequestDone(FRT_RPCRequest *req) override;
};
//-----------------------------------------------------------------------------
@@ -50,7 +50,7 @@ public:
/**
* Destructor. No cleanup needed for base class.
*/
- virtual ~FRT_ITimeoutHandler(void) {}
+ virtual ~FRT_ITimeoutHandler() {}
virtual void HandleTimeout() = 0;
};
@@ -80,9 +80,9 @@ public:
void HandleDone(bool freeChannel);
bool Invoke(bool freeChannel);
- virtual void HandleReturn();
- virtual FNET_Connection *GetConnection();
- virtual void Run(FastOS_ThreadInterface *, void *);
+ void HandleReturn() override;
+ FNET_Connection *GetConnection() override;
+ void Run(FastOS_ThreadInterface *, void *) override;
};
//-----------------------------------------------------------------------------
@@ -109,8 +109,8 @@ public:
}
void Invoke();
- virtual void HandleReturn();
- virtual FNET_Connection *GetConnection();
+ void HandleReturn() override;
+ FNET_Connection *GetConnection() override;
};
//-----------------------------------------------------------------------------
@@ -136,9 +136,9 @@ public:
void HandleDone();
- virtual bool HandleAbort();
- virtual void PerformTask();
- virtual HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context);
+ bool HandleAbort() override;
+ void PerformTask() override;
+ HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override;
};
//-----------------------------------------------------------------------------
diff --git a/fnet/src/vespa/fnet/frt/packets.h b/fnet/src/vespa/fnet/frt/packets.h
index 149da0746bf..58b1e1f30e3 100644
--- a/fnet/src/vespa/fnet/frt/packets.h
+++ b/fnet/src/vespa/fnet/frt/packets.h
@@ -44,8 +44,8 @@ public:
bool LittleEndian() { return (_flags & FLAG_FRT_RPC_LITTLE_ENDIAN) != 0; }
bool NoReply() { return (_flags & FLAG_FRT_RPC_NOREPLY) != 0; }
- virtual ~FRT_RPCPacket();
- virtual void Free();
+ ~FRT_RPCPacket();
+ void Free() override;
};
@@ -57,11 +57,11 @@ public:
bool ownsRef)
: FRT_RPCPacket(req, flags, ownsRef) {}
- virtual uint32_t GetPCODE();
- virtual uint32_t GetLength();
- virtual void Encode(FNET_DataBuffer *dst);
- virtual bool Decode(FNET_DataBuffer *src, uint32_t len);
- virtual vespalib::string Print(uint32_t indent = 0);
+ uint32_t GetPCODE() override;
+ uint32_t GetLength() override;
+ void Encode(FNET_DataBuffer *dst) override;
+ bool Decode(FNET_DataBuffer *src, uint32_t len) override;
+ vespalib::string Print(uint32_t indent = 0) override;
};
@@ -73,11 +73,11 @@ public:
bool ownsRef)
: FRT_RPCPacket(req, flags, ownsRef) {}
- virtual uint32_t GetPCODE();
- virtual uint32_t GetLength();
- virtual void Encode(FNET_DataBuffer *dst);
- virtual bool Decode(FNET_DataBuffer *src, uint32_t len);
- virtual vespalib::string Print(uint32_t indent = 0);
+ uint32_t GetPCODE() override;
+ uint32_t GetLength() override;
+ void Encode(FNET_DataBuffer *dst) override;
+ bool Decode(FNET_DataBuffer *src, uint32_t len) override;
+ vespalib::string Print(uint32_t indent = 0) override;
};
@@ -89,18 +89,18 @@ public:
bool ownsRef)
: FRT_RPCPacket(req, flags, ownsRef) {}
- virtual uint32_t GetPCODE();
- virtual uint32_t GetLength();
- virtual void Encode(FNET_DataBuffer *dst);
- virtual bool Decode(FNET_DataBuffer *src, uint32_t len);
- virtual vespalib::string Print(uint32_t indent = 0);
+ uint32_t GetPCODE() override;
+ uint32_t GetLength() override;
+ void Encode(FNET_DataBuffer *dst) override;
+ bool Decode(FNET_DataBuffer *src, uint32_t len) override;
+ vespalib::string Print(uint32_t indent = 0) override;
};
class FRT_PacketFactory : public FNET_IPacketFactory
{
public:
- FNET_Packet *CreatePacket(uint32_t pcode, FNET_Context context);
+ FNET_Packet *CreatePacket(uint32_t pcode, FNET_Context context) override;
};
VESPA_CAN_SKIP_DESTRUCTION(FRT_RPCRequestPacket)
diff --git a/fnet/src/vespa/fnet/frt/supervisor.h b/fnet/src/vespa/fnet/frt/supervisor.h
index f58f4c7ae68..dab0e236a35 100644
--- a/fnet/src/vespa/fnet/frt/supervisor.h
+++ b/fnet/src/vespa/fnet/frt/supervisor.h
@@ -54,15 +54,15 @@ public:
public:
ConnHooks(FRT_Supervisor &parent);
- virtual ~ConnHooks();
+ ~ConnHooks();
void SetSessionInitHook(FRT_METHOD_PT method, FRT_Invokable *handler);
void SetSessionDownHook(FRT_METHOD_PT method, FRT_Invokable *handler);
void SetSessionFiniHook(FRT_METHOD_PT method, FRT_Invokable *handler);
void InvokeHook(FRT_Method *hook, FNET_Connection *conn);
bool InitAdminChannel(FNET_Channel *channel);
- HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context);
- void Cleanup(FNET_Connection *conn);
+ HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override;
+ void Cleanup(FNET_Connection *conn) override;
};
private:
@@ -134,11 +134,11 @@ public:
double timeout);
// FNET ServerAdapter Interface
- bool InitAdminChannel(FNET_Channel *channel);
- bool InitChannel(FNET_Channel *channel, uint32_t pcode);
+ bool InitAdminChannel(FNET_Channel *channel) override;
+ bool InitChannel(FNET_Channel *channel, uint32_t pcode) override;
// Packet Handling
- HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context);
+ HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override;
// Methods for controlling transport object in standalone mode
bool Start();
diff --git a/fnet/src/vespa/fnet/packetqueue.h b/fnet/src/vespa/fnet/packetqueue.h
index 47182494f0c..3e2623540fb 100644
--- a/fnet/src/vespa/fnet/packetqueue.h
+++ b/fnet/src/vespa/fnet/packetqueue.h
@@ -88,8 +88,7 @@ public:
* @param packet the packet to handle.
* @param context the packet context.
**/
- virtual HP_RetCode HandlePacket(FNET_Packet *packet,
- FNET_Context context);
+ HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override;
/**
@@ -189,7 +188,7 @@ public:
* as a packet handler. Default is FNET_KEEP_CHANNEL.
**/
FNET_PacketQueue(uint32_t len = 64, HP_RetCode hpRetCode = FNET_KEEP_CHANNEL);
- virtual ~FNET_PacketQueue();
+ ~FNET_PacketQueue();
/**
@@ -235,8 +234,7 @@ public:
* @param packet the packet to handle.
* @param context the packet context.
**/
- virtual HP_RetCode HandlePacket(FNET_Packet *packet,
- FNET_Context context);
+ HP_RetCode HandlePacket(FNET_Packet *packet, FNET_Context context) override;
/**
diff --git a/fnet/src/vespa/fnet/transport_thread.cpp b/fnet/src/vespa/fnet/transport_thread.cpp
index e8da525dbb9..e1a6d31a03e 100644
--- a/fnet/src/vespa/fnet/transport_thread.cpp
+++ b/fnet/src/vespa/fnet/transport_thread.cpp
@@ -18,7 +18,7 @@ namespace {
struct Sync : public FNET_IExecutable
{
vespalib::Gate gate;
- virtual void execute() {
+ void execute() override {
gate.countDown();
}
};
diff --git a/fnet/src/vespa/fnet/transport_thread.h b/fnet/src/vespa/fnet/transport_thread.h
index 0f587a2fc6a..a9e1f056d17 100644
--- a/fnet/src/vespa/fnet/transport_thread.h
+++ b/fnet/src/vespa/fnet/transport_thread.h
@@ -41,7 +41,7 @@ public:
StatsTask(FNET_Scheduler *scheduler,
FNET_TransportThread *transport) : FNET_Task(scheduler),
_transport(transport) {}
- virtual void PerformTask();
+ void PerformTask() override;
};
friend class FNET_TransportThread::StatsTask;
#endif // DOXYGEN
@@ -624,5 +624,5 @@ public:
* to combine the FNET event loop with your own, you may use the
* @ref InitEventLoop and @ref EventLoopIteration methods directly.
**/
- void Run(FastOS_ThreadInterface *thisThread, void *args);
+ void Run(FastOS_ThreadInterface *thisThread, void *args) override;
};