default;
IPAddressFormatException& operator=(IPAddressFormatException&&) = default;
- virtual ~IPAddressFormatException() noexcept {}
- virtual const char *what(void) const noexcept {
+ ~IPAddressFormatException() noexcept override {}
+ const char* what(void) const noexcept override {
return msg_.c_str();
}
/// The exception thrown when wait()ing on an isShutdown() LifoSem
struct ShutdownSemError : public std::runtime_error {
explicit ShutdownSemError(const std::string& msg);
- virtual ~ShutdownSemError() noexcept;
+ ~ShutdownSemError() noexcept override;
};
namespace detail {
void registerSingleton(CreateFunc c, TeardownFunc t);
void registerSingletonMock(CreateFunc c, TeardownFunc t);
- virtual bool hasLiveInstance() override;
- virtual void createInstance() override;
- virtual bool creationStarted() override;
- virtual void preDestroyInstance(ReadMostlyMainPtrDeleter<>&) override;
- virtual void destroyInstance() override;
+ bool hasLiveInstance() override;
+ void createInstance() override;
+ bool creationStarted() override;
+ void preDestroyInstance(ReadMostlyMainPtrDeleter<>&) override;
+ void destroyInstance() override;
private:
SingletonHolder(TypeDescriptor type, SingletonVault& vault);
class CalledProcessError : public SubprocessError {
public:
explicit CalledProcessError(ProcessReturnCode rc);
- ~CalledProcessError() throw() = default;
+ ~CalledProcessError() throw() override = default;
const char* what() const throw() override { return what_.c_str(); }
ProcessReturnCode returnCode() const { return returnCode_; }
private:
class SubprocessSpawnError : public SubprocessError {
public:
SubprocessSpawnError(const char* executable, int errCode, int errnoValue);
- ~SubprocessSpawnError() throw() = default;
+ ~SubprocessSpawnError() throw() override = default;
const char* what() const throw() override { return what_.c_str(); }
int errnoValue() const { return errnoValue_; }
explicit TypeError(const std::string& expected, dynamic::Type actual);
explicit TypeError(const std::string& expected,
dynamic::Type actual1, dynamic::Type actual2);
- ~TypeError();
+ ~TypeError() override;
};
public:
void* allocate(
const size_t bytes,
- const size_t alignment = alignof(std::max_align_t)) {
+ const size_t alignment = alignof(std::max_align_t)) override {
(void)alignment;
void* p = static_cast<void*>(new char[bytes]);
DEBUG_PRINT(this << " " << p << " " << bytes);
void deallocate(
void* p,
const size_t bytes,
- const size_t alignment = alignof(std::max_align_t)) {
+ const size_t alignment = alignof(std::max_align_t)) override {
(void)alignment;
(void)bytes;
DEBUG_PRINT(p << " " << bytes);
class MyMemoryResource : public memory_resource {
public:
- void* allocate(const size_t sz, const size_t /* align */) {
+ void* allocate(const size_t sz, const size_t /* align */) override {
void* p = malloc(sz);
DEBUG_PRINT(p << " " << sz);
return p;
}
- void deallocate(void* p, const size_t sz, const size_t /* align */) {
+ void deallocate(void* p, const size_t sz, const size_t /* align */) override {
DEBUG_PRINT(p << " " << sz);
free(p);
}
class MineMemoryResource : public memory_resource {
public:
- void* allocate(const size_t sz, const size_t /* align */) {
+ void* allocate(const size_t sz, const size_t /* align */) override {
void* p = malloc(sz);
DEBUG_PRINT(p << " " << sz);
return p;
}
- void deallocate(void* p, const size_t sz, const size_t /* align */) {
+ void deallocate(void* p, const size_t sz, const size_t /* align */) override {
DEBUG_PRINT(p << " " << sz);
free(p);
}
public:
explicit FDSymbolizePrinter(int fd, int options=0,
size_t bufferSize=0);
- ~FDSymbolizePrinter();
+ ~FDSymbolizePrinter() override;
void flush();
private:
void doPrint(StringPiece sp) override;
class EventBaseLoopController : public LoopController {
public:
explicit EventBaseLoopController();
- ~EventBaseLoopController();
+ ~EventBaseLoopController() override;
/**
* Attach EventBase after LoopController was created.
class DestructionCallback : public folly::EventBase::LoopCallback {
public:
DestructionCallback() : alive_(new int(42)) {}
- ~DestructionCallback() {
+ ~DestructionCallback() override {
reset();
}
std::unique_ptr<LoopController> loopController,
Options options = Options());
- ~FiberManager();
+ ~FiberManager() override;
/**
* Controller access.
class DrivableExecutor : public virtual Executor {
public:
- virtual ~DrivableExecutor() = default;
+ ~DrivableExecutor() override = default;
// Make progress on this Executor's work.
//
}
- virtual void scheduleAt(Func&& f, TimePoint const& t) override {
+ void scheduleAt(Func&& f, TimePoint const& t) override {
std::lock_guard<std::mutex> lock(lock_);
scheduledFuncs_.emplace(t, std::move(f));
sem_.post();
typedef std::chrono::microseconds Duration;
typedef std::chrono::steady_clock::time_point TimePoint;
- virtual ~ScheduledExecutor() = default;
+ ~ScheduledExecutor() override = default;
- virtual void add(Func) override = 0;
+ void add(Func) override = 0;
/// Alias for add() (for Rx consistency)
void schedule(Func&& a) { add(std::move(a)); }
public:
explicit WrapperImpl(Wrapped wrapped) : wrapped_(std::move(wrapped)) {}
- virtual bool apply(const std::function<bool(Value)>& handler) const {
+ bool apply(const std::function<bool(Value)>& handler) const override {
return wrapped_.apply(handler);
}
- virtual void foreach(const std::function<void(Value)>& body) const {
+ void foreach(const std::function<void(Value)>& body) const override {
wrapped_.foreach(body);
}
- virtual std::unique_ptr<const WrapperBase> clone() const {
+ std::unique_ptr<const WrapperBase> clone() const override {
return std::unique_ptr<const WrapperBase>(new WrapperImpl(wrapped_));
}
};
public:
static std::unique_ptr<Codec> create(int level, CodecType type);
explicit LZ4FrameCodec(int level, CodecType type);
- ~LZ4FrameCodec();
+ ~LZ4FrameCodec() override;
std::vector<std::string> validPrefixes() const override;
bool canUncompress(const IOBuf* data, Optional<uint64_t> uncompressedLength)
typedef typename UniquePtr::deleter_type Deleter;
explicit UniquePtrDeleter(Deleter deleter) : deleter_(std::move(deleter)){ }
- void dispose(void* p) {
+ void dispose(void* p) override {
try {
deleter_(static_cast<Pointer>(p));
delete this;
}
private:
- ~AsyncPipeReader();
+ ~AsyncPipeReader() override;
void handlerReady(uint16_t events) noexcept override;
void failRead(const AsyncSocketException& ex);
bool closeOnEmpty_{false};
std::function<void(int)> closeCb_;
- ~AsyncPipeWriter() {
+ ~AsyncPipeWriter() override {
closeNow();
}
};
return timeout_;
}
- virtual void timeoutExpired() noexcept override {
+ void timeoutExpired() noexcept override {
sslSocket_->timeoutExpired(timeout_);
}
// See the documentation in TAsyncTransport.h
// TODO: implement graceful shutdown in close()
// TODO: implement detachSSL() that returns the SSL connection
- virtual void closeNow() override;
- virtual void shutdownWrite() override;
- virtual void shutdownWriteNow() override;
- virtual bool good() const override;
- virtual bool connecting() const override;
- virtual std::string getApplicationProtocol() noexcept override;
-
- virtual std::string getSecurityProtocol() const override { return "TLS"; }
-
- virtual void setEorTracking(bool track) override;
- virtual size_t getRawBytesWritten() const override;
- virtual size_t getRawBytesReceived() const override;
+ void closeNow() override;
+ void shutdownWrite() override;
+ void shutdownWriteNow() override;
+ bool good() const override;
+ bool connecting() const override;
+ std::string getApplicationProtocol() noexcept override;
+
+ std::string getSecurityProtocol() const override {
+ return "TLS";
+ }
+
+ void setEorTracking(bool track) override;
+ size_t getRawBytesWritten() const override;
+ size_t getRawBytesReceived() const override;
void enableClientHelloParsing();
/**
/**
* Get the certificate used for this SSL connection. May be null
*/
- virtual const X509* getSelfCert() const override;
+ const X509* getSelfCert() const override;
- virtual void attachEventBase(EventBase* eventBase) override {
+ void attachEventBase(EventBase* eventBase) override {
AsyncSocket::attachEventBase(eventBase);
handshakeTimeout_.attachEventBase(eventBase);
connectionTimeout_.attachEventBase(eventBase);
}
- virtual void detachEventBase() override {
+ void detachEventBase() override {
AsyncSocket::detachEventBase();
handshakeTimeout_.detachEventBase();
connectionTimeout_.detachEventBase();
}
- virtual bool isDetachable() const override {
+ bool isDetachable() const override {
return AsyncSocket::isDetachable() && !handshakeTimeout_.isScheduled();
}
/**
* Returns the peer certificate, or nullptr if no peer certificate received.
*/
- virtual ssl::X509UniquePtr getPeerCert() const override {
+ ssl::X509UniquePtr getPeerCert() const override {
if (!ssl_) {
return nullptr;
}
* destroy() instead. (See the documentation in DelayedDestruction.h for
* more details.)
*/
- ~AsyncSSLSocket();
+ ~AsyncSSLSocket() override;
// Inherit event notification methods from AsyncSocket except
// the following.
int* sslErrorOut,
unsigned long* errErrorOut) noexcept;
- virtual void checkForImmediateRead() noexcept override;
+ void checkForImmediateRead() noexcept override;
// AsyncSocket calls this at the wrong time for SSL
void handleInitialReadWrite() noexcept override {}
* time after destroy() returns. They will not receive any more callback
* invocations once acceptStopped() is invoked.
*/
- virtual void destroy();
+ void destroy() override;
/**
* Attach this AsyncServerSocket to its primary EventBase.
/**
* Get the EventBase used by this socket.
*/
- EventBase* getEventBase() const {
+ EventBase* getEventBase() const override {
return eventBase_;
}
*
* Throws TTransportException on error.
*/
- void getAddress(SocketAddress* addressReturn) const;
+ void getAddress(SocketAddress* addressReturn) const override;
/**
* Get the local address to which the socket is bound.
*
* Invoke destroy() instead to destroy the AsyncServerSocket.
*/
- virtual ~AsyncServerSocket();
+ ~AsyncServerSocket() override;
private:
enum class MessageType {
: callback_(callback),
connectionEventCallback_(connectionEventCallback) {}
- ~RemoteAcceptor() = default;
+ ~RemoteAcceptor() override = default;
void start(EventBase *eventBase, uint32_t maxAtOnce, uint32_t maxInQueue);
void stop(EventBase* eventBase, AcceptCallback* callback);
- virtual void messageAvailable(QueueMessage&& message) noexcept override;
+ void messageAvailable(QueueMessage&& message) noexcept override;
NotificationQueue<QueueMessage>* getQueue() {
return &queue_;
}
// Inherited from EventHandler
- virtual void handlerReady(uint16_t events) noexcept {
+ void handlerReady(uint16_t events) noexcept override {
parent_->handlerReady(events, socket_, addressFamily_);
}
* This prevents callers from deleting a AsyncSocket while it is invoking a
* callback.
*/
- virtual void destroy() override;
+ void destroy() override;
/**
* Get the EventBase used by this socket.
* destroy() instead. (See the documentation in DelayedDestruction.h for
* more details.)
*/
- ~AsyncSocket();
+ ~AsyncSocket() override;
friend std::ostream& operator << (std::ostream& os, const StateEnum& state);
: AsyncTimeout(eventBase)
, socket_(socket) {}
- virtual void timeoutExpired() noexcept {
+ void timeoutExpired() noexcept override {
socket_->timeoutExpired();
}
: EventHandler(eventBase, fd)
, socket_(socket) {}
- virtual void handlerReady(uint16_t events) noexcept {
+ void handlerReady(uint16_t events) noexcept override {
socket_->ioReady(events);
}
callback_(std::forward<UCallback>(callback))
{}
- void timeoutExpired() noexcept {
+ void timeoutExpired() noexcept override {
static_assert(
noexcept(std::declval<TCallback>()()),
"callback must be declared noexcept, e.g.: `[]() noexcept {}`"
return addr;
}
- virtual void getAddress(SocketAddress* address) const {
+ void getAddress(SocketAddress* address) const override {
getLocalAddress(address);
}
}
protected:
- virtual ~AsyncTransport() = default;
+ ~AsyncTransport() override = default;
};
class AsyncReader {
// to keep compatibility.
using ReadCallback = AsyncReader::ReadCallback;
using WriteCallback = AsyncWriter::WriteCallback;
- virtual void setReadCB(ReadCallback* callback) override = 0;
- virtual ReadCallback* getReadCallback() const override = 0;
- virtual void write(WriteCallback* callback, const void* buf, size_t bytes,
- WriteFlags flags = WriteFlags::NONE) override = 0;
- virtual void writev(WriteCallback* callback, const iovec* vec, size_t count,
- WriteFlags flags = WriteFlags::NONE) override = 0;
- virtual void writeChain(WriteCallback* callback,
- std::unique_ptr<IOBuf>&& buf,
- WriteFlags flags = WriteFlags::NONE) override = 0;
+ void setReadCB(ReadCallback* callback) override = 0;
+ ReadCallback* getReadCallback() const override = 0;
+ void write(
+ WriteCallback* callback,
+ const void* buf,
+ size_t bytes,
+ WriteFlags flags = WriteFlags::NONE) override = 0;
+ void writev(
+ WriteCallback* callback,
+ const iovec* vec,
+ size_t count,
+ WriteFlags flags = WriteFlags::NONE) override = 0;
+ void writeChain(
+ WriteCallback* callback,
+ std::unique_ptr<IOBuf>&& buf,
+ WriteFlags flags = WriteFlags::NONE) override = 0;
/**
* The transport wrapper may wrap another transport. This returns the
* transport that is wrapped. It returns nullptr if there is no wrapped
nextListener_(0) {
}
- ~AsyncUDPServerSocket() {
+ ~AsyncUDPServerSocket() override {
if (socket_) {
close();
}
return socket_->address();
}
- void getAddress(SocketAddress* a) const {
+ void getAddress(SocketAddress* a) const override {
*a = address();
}
socket_.reset();
}
- EventBase* getEventBase() const {
+ EventBase* getEventBase() const override {
return evb_;
}
private:
// AsyncUDPSocket::ReadCallback
- void getReadBuffer(void** buf, size_t* len) noexcept {
+ void getReadBuffer(void** buf, size_t* len) noexcept override {
std::tie(*buf, *len) = buf_.preallocate(packetSize_, packetSize_);
}
- void onDataAvailable(const folly::SocketAddress& clientAddress,
- size_t len,
- bool truncated) noexcept {
+ void onDataAvailable(
+ const folly::SocketAddress& clientAddress,
+ size_t len,
+ bool truncated) noexcept override {
buf_.postallocate(len);
auto data = buf_.split(len);
++nextListener_;
}
- void onReadError(const AsyncSocketException& ex) noexcept {
+ void onReadError(const AsyncSocketException& ex) noexcept override {
LOG(ERROR) << ex.what();
// Lets register to continue listening for packets
socket_->resumeRead(this);
}
- void onReadClosed() noexcept {
+ void onReadClosed() noexcept override {
for (auto& listener: listeners_) {
auto callback = listener.second;
* given eventbase
*/
explicit AsyncUDPSocket(EventBase* evb);
- ~AsyncUDPSocket();
+ ~AsyncUDPSocket() override;
/**
* Returns the address server is listening on
AsyncUDPSocket& operator=(const AsyncUDPSocket&) = delete;
// EventHandler
- void handlerReady(uint16_t events) noexcept;
+ void handlerReady(uint16_t events) noexcept override;
void handleRead() noexcept;
bool updateRegistration() noexcept;
}
// folly::AsyncTransportWrapper
- virtual ReadCallback* getReadCallback() const override {
+ ReadCallback* getReadCallback() const override {
return transport_->getReadCallback();
}
- virtual void setReadCB(
+ void setReadCB(
folly::AsyncTransportWrapper::ReadCallback* callback) override {
transport_->setReadCB(callback);
}
- virtual void write(
+ void write(
folly::AsyncTransportWrapper::WriteCallback* callback,
const void* buf,
size_t bytes,
transport_->write(callback, buf, bytes, flags);
}
- virtual void writeChain(
+ void writeChain(
folly::AsyncTransportWrapper::WriteCallback* callback,
std::unique_ptr<folly::IOBuf>&& buf,
folly::WriteFlags flags = folly::WriteFlags::NONE) override {
transport_->writeChain(callback, std::move(buf), flags);
}
- virtual void writev(
+ void writev(
folly::AsyncTransportWrapper::WriteCallback* callback,
const iovec* vec,
size_t bytes,
}
// folly::AsyncSocketBase
- virtual folly::EventBase* getEventBase() const override {
+ folly::EventBase* getEventBase() const override {
return transport_->getEventBase();
}
// folly::AsyncTransport
- virtual void attachEventBase(folly::EventBase* eventBase) override {
+ void attachEventBase(folly::EventBase* eventBase) override {
transport_->attachEventBase(eventBase);
}
- virtual void close() override {
+ void close() override {
transport_->close();
}
- virtual void closeNow() override {
+ void closeNow() override {
transport_->closeNow();
}
- virtual void closeWithReset() override {
+ void closeWithReset() override {
transport_->closeWithReset();
// This will likely result in 2 closeNow() calls on the decorated transport,
closeNow();
}
- virtual bool connecting() const override {
+ bool connecting() const override {
return transport_->connecting();
}
- virtual void detachEventBase() override {
+ void detachEventBase() override {
transport_->detachEventBase();
}
- virtual bool error() const override {
+ bool error() const override {
return transport_->error();
}
- virtual size_t getAppBytesReceived() const override {
+ size_t getAppBytesReceived() const override {
return transport_->getAppBytesReceived();
}
- virtual size_t getAppBytesWritten() const override {
+ size_t getAppBytesWritten() const override {
return transport_->getAppBytesWritten();
}
- virtual void getLocalAddress(folly::SocketAddress* address) const override {
+ void getLocalAddress(folly::SocketAddress* address) const override {
return transport_->getLocalAddress(address);
}
- virtual void getPeerAddress(folly::SocketAddress* address) const override {
+ void getPeerAddress(folly::SocketAddress* address) const override {
return transport_->getPeerAddress(address);
}
- virtual folly::ssl::X509UniquePtr getPeerCert() const override {
+ folly::ssl::X509UniquePtr getPeerCert() const override {
return transport_->getPeerCert();
}
- virtual size_t getRawBytesReceived() const override {
+ size_t getRawBytesReceived() const override {
return transport_->getRawBytesReceived();
}
- virtual size_t getRawBytesWritten() const override {
+ size_t getRawBytesWritten() const override {
return transport_->getRawBytesWritten();
}
- virtual uint32_t getSendTimeout() const override {
+ uint32_t getSendTimeout() const override {
return transport_->getSendTimeout();
}
- virtual bool good() const override {
+ bool good() const override {
return transport_->good();
}
- virtual bool isDetachable() const override {
+ bool isDetachable() const override {
return transport_->isDetachable();
}
- virtual bool isEorTrackingEnabled() const override {
+ bool isEorTrackingEnabled() const override {
return transport_->isEorTrackingEnabled();
}
- virtual bool readable() const override {
+ bool readable() const override {
return transport_->readable();
}
- virtual bool writable() const override {
+ bool writable() const override {
return transport_->writable();
}
- virtual void setEorTracking(bool track) override {
+ void setEorTracking(bool track) override {
return transport_->setEorTracking(track);
}
- virtual void setSendTimeout(uint32_t timeoutInMs) override {
+ void setSendTimeout(uint32_t timeoutInMs) override {
transport_->setSendTimeout(timeoutInMs);
}
- virtual void shutdownWrite() override {
+ void shutdownWrite() override {
transport_->shutdownWrite();
}
- virtual void shutdownWriteNow() override {
+ void shutdownWriteNow() override {
transport_->shutdownWriteNow();
}
- virtual std::string getApplicationProtocol() noexcept override {
+ std::string getApplicationProtocol() noexcept override {
return transport_->getApplicationProtocol();
}
- virtual std::string getSecurityProtocol() const override {
+ std::string getSecurityProtocol() const override {
return transport_->getSecurityProtocol();
}
- virtual bool isReplaySafe() const override {
+ bool isReplaySafe() const override {
return transport_->isReplaySafe();
}
- virtual void setReplaySafetyCallback(
+ void setReplaySafetyCallback(
folly::AsyncTransport::ReplaySafetyCallback* callback) override {
transport_->setReplaySafetyCallback(callback);
}
protected:
- virtual ~DecoratedAsyncTransportWrapper() {}
+ ~DecoratedAsyncTransportWrapper() override {}
typename T::UniquePtr transport_;
};
* shared_ptr using a DelayedDestruction::Destructor as the second argument
* to the shared_ptr constructor.
*/
- virtual ~DelayedDestruction() = default;
+ ~DelayedDestruction() override = default;
DelayedDestruction()
: destroyPending_(false) {
* observer, max latency and avg loop time.
*/
explicit EventBase(event_base* evb, bool enableTimeMeasurement = true);
- ~EventBase();
+ ~EventBase() override;
/**
* Runs the event loop.
* first handler fired within that cycle.
*
*/
- void bumpHandlingTime() override final;
+ void bumpHandlingTime() final;
class SmoothLoopTime {
public:
// TimeoutManager
void attachTimeoutManager(
AsyncTimeout* obj,
- TimeoutManager::InternalEnum internal) override final;
+ TimeoutManager::InternalEnum internal) final;
- void detachTimeoutManager(AsyncTimeout* obj) override final;
+ void detachTimeoutManager(AsyncTimeout* obj) final;
bool scheduleTimeout(AsyncTimeout* obj, TimeoutManager::timeout_type timeout)
- override final;
+ final;
- void cancelTimeout(AsyncTimeout* obj) override final;
+ void cancelTimeout(AsyncTimeout* obj) final;
- bool isInTimeoutManagerThread() override final {
+ bool isInTimeoutManagerThread() final {
return isInEventBaseThread();
}
class EventBaseLocalBase : public EventBaseLocalBaseBase, boost::noncopyable {
public:
EventBaseLocalBase() {}
- virtual ~EventBaseLocalBase();
+ ~EventBaseLocalBase() override;
void erase(EventBase& evb);
void onEventBaseDestruction(EventBase& evb) override;
* Use destroy() instead. See the comments in DelayedDestruction for more
* details.
*/
- virtual ~HHWheelTimer();
+ ~HHWheelTimer() override;
private:
// Forbidden copy constructor and assignment operator
HHWheelTimer& operator=(HHWheelTimer const &) = delete;
// Methods inherited from AsyncTimeout
- virtual void timeoutExpired() noexcept;
+ void timeoutExpired() noexcept override;
std::chrono::milliseconds interval_;
std::chrono::milliseconds defaultTimeout_;
void destroy() override;
- virtual ~Consumer() {}
+ ~Consumer() override {}
private:
/**
VirtualEventBase(const VirtualEventBase&) = delete;
VirtualEventBase& operator=(const VirtualEventBase&) = delete;
- ~VirtualEventBase();
+ ~VirtualEventBase() override;
EventBase& getEventBase() {
return evb_;
public:
using DecoratedAsyncTransportWrapper<T>::DecoratedAsyncTransportWrapper;
- virtual void write(
+ void write(
folly::AsyncTransportWrapper::WriteCallback* callback,
const void* buf,
size_t bytes,
writeChain(callback, std::move(ioBuf), flags);
}
- virtual void writev(
+ void writev(
folly::AsyncTransportWrapper::WriteCallback* callback,
const iovec* vec,
size_t count,
* It only makes sense to use this class if you override writeChain, so force
* derived classes to do that.
*/
- virtual void writeChain(
+ void writeChain(
folly::AsyncTransportWrapper::WriteCallback* callback,
std::unique_ptr<folly::IOBuf>&& buf,
folly::WriteFlags flags = folly::WriteFlags::NONE) override = 0;
class ConnCallback : public AsyncSocket::ConnectCallback {
public:
- virtual void connectSuccess() noexcept override {
+ void connectSuccess() noexcept override {
state = State::SUCCESS;
}
- virtual void connectErr(const AsyncSocketException& ex) noexcept override {
+ void connectErr(const AsyncSocketException& ex) noexcept override {
state = State::ERROR;
error = ex.what();
}
, exception(AsyncSocketException::UNKNOWN, "none")
, mcb_(mcb) {}
- ~WriteCallbackBase() {
+ ~WriteCallbackBase() override {
EXPECT_EQ(STATE_SUCCEEDED, state);
}
}
}
- virtual void writeSuccess() noexcept override {
+ void writeSuccess() noexcept override {
std::cerr << "writeSuccess" << std::endl;
state = STATE_SUCCEEDED;
}
explicit ExpectWriteErrorCallback(SendMsgParamsCallbackBase* mcb = nullptr)
: WriteCallbackBase(mcb) {}
- ~ExpectWriteErrorCallback() {
+ ~ExpectWriteErrorCallback() override {
EXPECT_EQ(STATE_FAILED, state);
EXPECT_EQ(exception.type_,
AsyncSocketException::AsyncSocketExceptionType::NETWORK_ERROR);
explicit WriteCheckTimestampCallback(SendMsgParamsCallbackBase* mcb = nullptr)
: WriteCallbackBase(mcb) {}
- ~WriteCheckTimestampCallback() {
+ ~WriteCheckTimestampCallback() override {
EXPECT_EQ(STATE_SUCCEEDED, state);
EXPECT_TRUE(gotTimestamp_);
EXPECT_TRUE(gotByteSeq_);
explicit ReadCallbackBase(WriteCallbackBase* wcb)
: wcb_(wcb), state(STATE_WAITING) {}
- ~ReadCallbackBase() {
+ ~ReadCallbackBase() override {
EXPECT_EQ(STATE_SUCCEEDED, state);
}
: ReadCallbackBase(wcb)
, buffers() {}
- ~ReadCallback() {
+ ~ReadCallback() override {
for (std::vector<Buffer>::iterator it = buffers.begin();
it != buffers.end();
++it) {
cv_.wait(lock, [this] { return state != STATE_WAITING; });
}
- ~HandshakeCallback() {
+ ~HandshakeCallback() override {
EXPECT_EQ(STATE_SUCCEEDED, state);
}
SSLServerAcceptCallbackBase(hcb),
timeout_(timeout) {}
- virtual ~SSLServerAcceptCallback() {
+ ~SSLServerAcceptCallback() override {
if (timeout_ > 0) {
// if we set a timeout, we expect failure
EXPECT_EQ(hcb_->state, STATE_FAILED);
socket_->sslAccept(this);
}
- ~RenegotiatingServer() {
+ ~RenegotiatingServer() override {
socket_->setReadCB(nullptr);
}
memset(buf_, 'a', sizeof(buf_));
}
- ~SSLClient() {
+ ~SSLClient() override {
if (session_) {
SSL_SESSION_free(session_);
}
buffers(),
maxBufferSz(_maxBufferSz) {}
- ~ReadCallback() {
+ ~ReadCallback() override {
for (std::vector<Buffer>::iterator it = buffers.begin();
it != buffers.end();
++it) {
class TestConnectionEventCallback
: public AsyncServerSocket::ConnectionEventCallback {
public:
- virtual void onConnectionAccepted(
+ void onConnectionAccepted(
const int /* socket */,
const SocketAddress& /* addr */) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
connectionAccepted_++;
}
- virtual void onConnectionAcceptError(const int /* err */) noexcept override {
+ void onConnectionAcceptError(const int /* err */) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
connectionAcceptedError_++;
}
- virtual void onConnectionDropped(
+ void onConnectionDropped(
const int /* socket */,
const SocketAddress& /* addr */) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
connectionDropped_++;
}
- virtual void onConnectionEnqueuedForAcceptorCallback(
+ void onConnectionEnqueuedForAcceptorCallback(
const int /* socket */,
const SocketAddress& /* addr */) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
connectionEnqueuedForAcceptCallback_++;
}
- virtual void onConnectionDequeuedByAcceptorCallback(
+ void onConnectionDequeuedByAcceptorCallback(
const int /* socket */,
const SocketAddress& /* addr */) noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
connectionDequeuedByAcceptCallback_++;
}
- virtual void onBackoffStarted() noexcept override {
+ void onBackoffStarted() noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
backoffStarted_++;
}
- virtual void onBackoffEnded() noexcept override {
+ void onBackoffEnded() noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
backoffEnded_++;
}
- virtual void onBackoffError() noexcept override {
+ void onBackoffError() noexcept override {
folly::RWSpinLock::WriteHolder holder(spinLock_);
backoffError_++;
}
using namespace folly;
class DeleteGuarder : public DelayedDestruction {
-
- ~DeleteGuarder() {
+ ~DeleteGuarder() override {
doFoo();
}
std::function<void(int)> *fn;
protected:
- virtual ~DestroyTestConsumer() = default;
+ ~DestroyTestConsumer() override = default;
};
EventBase eventBase;
public:
explicit DeadlockTestData(const std::string& val) : val_(val) {}
- virtual ~DeadlockTestData() {
+ ~DeadlockTestData() override {
RequestContext::get()->setContextData(
val_, std::make_unique<TestData>(1));
}
explicit SSLServerAcceptCallbackBase(HandshakeCallback* hcb)
: state(STATE_WAITING), hcb_(hcb) {}
- ~SSLServerAcceptCallbackBase() {
+ ~SSLServerAcceptCallbackBase() override {
EXPECT_EQ(STATE_SUCCEEDED, state);
}
* the object directly from the event loop (e.g., directly from a
* EventBase::LoopCallback), or when the event loop is stopped.
*/
- virtual ~UndelayedDestruction() {
+ ~UndelayedDestruction() override {
// Crash if the caller is destroying us with outstanding destructor guards.
if (this->getDestructorGuardCount() != 0) {
abort();
}
// Allow this to be constructed on the stack for easier testing.
- virtual ~TestWriteChainAsyncTransportWrapper() {
- }
+ ~TestWriteChainAsyncTransportWrapper() override {}
};
MATCHER_P(BufMatches, expected, "") {
}
}
- virtual ~TestEagerInitParallelExecutor() override {
+ ~TestEagerInitParallelExecutor() override {
for (auto eb : eventBases_) {
eb->runInEventBaseThread([eb] { eb->terminateLoopSoon(); });
}
}
}
- virtual void add(folly::Func func) override {
+ void add(folly::Func func) override {
const auto index = (counter_ ++) % eventBases_.size();
eventBases_[index]->add(std::move(func));
}
struct VirtualImpl : VirtualBase {
void foo() override { /* noop */
}
- virtual ~VirtualImpl() {}
+ ~VirtualImpl() override {}
};
#ifndef __clang__
: public Subprocess::DangerousPostForkPreExecCallback {
explicit WriteFileAfterFork(std::string filename)
: filename_(std::move(filename)) {}
- virtual ~WriteFileAfterFork() {}
+ ~WriteFileAfterFork() override {}
int operator()() override {
return writeFile(std::string("ok"), filename_.c_str()) ? 0 : errno;
}