diff options
author | agorodilov <agorodilov@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
commit | 7a4979e6211c3e78c7f9041d4a9e5d3405343c36 (patch) | |
tree | 9e9943579e5a14679af7cd2cda3c36d8c0b775d3 /library/cpp/messagebus | |
parent | 676340c42e269f3070f194d160f42a83a10568d4 (diff) | |
download | ydb-7a4979e6211c3e78c7f9041d4a9e5d3405343c36.tar.gz |
Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus')
46 files changed, 174 insertions, 174 deletions
diff --git a/library/cpp/messagebus/actor/actor_ut.cpp b/library/cpp/messagebus/actor/actor_ut.cpp index b76ab55bfa..c8aca5e64c 100644 --- a/library/cpp/messagebus/actor/actor_ut.cpp +++ b/library/cpp/messagebus/actor/actor_ut.cpp @@ -59,7 +59,7 @@ struct TDecrementAndSendActor: public TTestActorBase<TDecrementAndSendActor>, pu TDecrementAndSendActor(TExecutor* executor) : TTestActorBase<TDecrementAndSendActor>(executor) - , Next(nullptr) + , Next(nullptr) { } diff --git a/library/cpp/messagebus/actor/executor.cpp b/library/cpp/messagebus/actor/executor.cpp index 7a2227a458..08791def08 100644 --- a/library/cpp/messagebus/actor/executor.cpp +++ b/library/cpp/messagebus/actor/executor.cpp @@ -290,7 +290,7 @@ TAutoPtr<IWorkItem> TExecutor::DequeueWork() { TWhatThreadDoesAcquireGuard<TMutex> g(WorkMutex, "executor: acquiring lock for DequeueWork"); while (!WorkItems.TryPop(&wi, &queueSize)) { if (AtomicGet(ExitWorkers) != 0) - return nullptr; + return nullptr; TWhatThreadDoesPushPop pp("waiting for work on condvar"); WorkAvailable.Wait(WorkMutex); diff --git a/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h b/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h index f0b7cd90e4..a03db713b1 100644 --- a/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h +++ b/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h @@ -31,7 +31,7 @@ public: AtomicSet(CachedSize, RingBuffer.Size()); } - bool TryPop(T* r, size_t* sizePtr = nullptr) { + bool TryPop(T* r, size_t* sizePtr = nullptr) { if (AtomicGet(CachedSize) == 0) { return false; } diff --git a/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h b/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h index 0aed6b9984..025d12f160 100644 --- a/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h +++ b/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h @@ -5,6 +5,6 @@ struct TDebugReceiverHandler: public NBus::IBusServerHandler { NBus::TBusServerSession* ServerSession; - void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; - void OnMessage(NBus::TOnMessageContext& message) override; + void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; + void OnMessage(NBus::TOnMessageContext& message) override; }; diff --git a/library/cpp/messagebus/event_loop.h b/library/cpp/messagebus/event_loop.h index d5b0a53b0c..71607621e2 100644 --- a/library/cpp/messagebus/event_loop.h +++ b/library/cpp/messagebus/event_loop.h @@ -50,14 +50,14 @@ namespace NEventLoop { class TEventLoop { public: - TEventLoop(const char* name = nullptr); + TEventLoop(const char* name = nullptr); ~TEventLoop(); void Run(); void Stop(); bool IsRunning(); - TChannelPtr Register(TSocket socket, TEventHandlerPtr, void* cookie = nullptr); + TChannelPtr Register(TSocket socket, TEventHandlerPtr, void* cookie = nullptr); private: class TImpl; diff --git a/library/cpp/messagebus/futex_like.cpp b/library/cpp/messagebus/futex_like.cpp index 7f965126db..1169155780 100644 --- a/library/cpp/messagebus/futex_like.cpp +++ b/library/cpp/messagebus/futex_like.cpp @@ -30,7 +30,7 @@ void TFutexLike::Wake(size_t count) { if (count > unsigned(Max<int>())) { count = Max<int>(); } - int r = futex(&Value, FUTEX_WAKE, count, nullptr, nullptr, 0); + int r = futex(&Value, FUTEX_WAKE, count, nullptr, nullptr, 0); Y_VERIFY(r >= 0, "futex_wake failed: %s", strerror(errno)); #else TGuard<TMutex> guard(Mutex); @@ -44,7 +44,7 @@ void TFutexLike::Wake(size_t count) { void TFutexLike::Wait(int expected) { #ifdef _linux_ - int r = futex(&Value, FUTEX_WAIT, expected, nullptr, nullptr, 0); + int r = futex(&Value, FUTEX_WAIT, expected, nullptr, nullptr, 0); Y_VERIFY(r >= 0 || errno == EWOULDBLOCK, "futex_wait failed: %s", strerror(errno)); #else TGuard<TMutex> guard(Mutex); diff --git a/library/cpp/messagebus/memory.h b/library/cpp/messagebus/memory.h index b2c0544491..fa8f3d64b5 100644 --- a/library/cpp/messagebus/memory.h +++ b/library/cpp/messagebus/memory.h @@ -13,7 +13,7 @@ static inline void* MallocAligned(size_t size, size_t alignment) { void** ptr = (void**)malloc(size + alignment + sizeof(size_t*)); if (!ptr) { - return nullptr; + return nullptr; } size_t mask = ~(alignment - 1); diff --git a/library/cpp/messagebus/misc/weak_ptr.h b/library/cpp/messagebus/misc/weak_ptr.h index 70fdeb0e2a..45f05cae56 100644 --- a/library/cpp/messagebus/misc/weak_ptr.h +++ b/library/cpp/messagebus/misc/weak_ptr.h @@ -24,7 +24,7 @@ private: void Release() { TGuard<TMutex> g(Mutex); Y_ASSERT(!!Outer); - Outer = nullptr; + Outer = nullptr; } TIntrusivePtr<TSelf> Get() { @@ -91,7 +91,7 @@ public: TIntrusivePtr<T> Get() { if (!RefPtr) { - return nullptr; + return nullptr; } else { return RefPtr->Get(); } diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp index 24bd778799..c335bfaed8 100644 --- a/library/cpp/messagebus/oldmodule/module.cpp +++ b/library/cpp/messagebus/oldmodule/module.cpp @@ -848,7 +848,7 @@ EMessageStatus TBusModule::StartJob(TAutoPtr<TBusMessage> message) { } void TModuleServerHandler::OnMessage(TOnMessageContext& msg) { - Module->OnMessageReceived(nullptr, msg); + Module->OnMessageReceived(nullptr, msg); } void TModuleClientHandler::OnReply(TAutoPtr<TBusMessage> req, TAutoPtr<TBusMessage> resp) { @@ -863,7 +863,7 @@ void TModuleClientHandler::OnMessageSentOneWay(TAutoPtr<TBusMessage> req) { TJobRunner* job = GetJob(req.Get()); Y_ASSERT(job); Y_ASSERT(job->Job->Message != req.Get()); - job->EnqueueAndSchedule(TJobResponseMessage(req.Release(), nullptr, MESSAGE_OK)); + job->EnqueueAndSchedule(TJobResponseMessage(req.Release(), nullptr, MESSAGE_OK)); job->UnRef(); } @@ -871,7 +871,7 @@ void TModuleClientHandler::OnError(TAutoPtr<TBusMessage> msg, EMessageStatus sta TJobRunner* job = GetJob(msg.Get()); if (job) { Y_ASSERT(job->Job->Message != msg.Get()); - job->EnqueueAndSchedule(TJobResponseMessage(msg.Release(), nullptr, status)); + job->EnqueueAndSchedule(TJobResponseMessage(msg.Release(), nullptr, status)); job->UnRef(); } } diff --git a/library/cpp/messagebus/protobuf/ybusbuf.cpp b/library/cpp/messagebus/protobuf/ybusbuf.cpp index 63415b3737..63849b8960 100644 --- a/library/cpp/messagebus/protobuf/ybusbuf.cpp +++ b/library/cpp/messagebus/protobuf/ybusbuf.cpp @@ -23,7 +23,7 @@ TBusBufferBase* TBusBufferProtocol::FindType(int type) { return Types[i]; } } - return nullptr; + return nullptr; } bool TBusBufferProtocol::IsRegisteredType(unsigned type) { @@ -67,8 +67,8 @@ TAutoPtr<TBusMessage> TBusBufferProtocol::Deserialize(ui16 messageType, TArrayRe TWhatThreadDoesPushPop pp("deserialize protobuf message"); TBusBufferBase* messageTemplate = FindType(messageType); - if (messageTemplate == nullptr) { - return nullptr; + if (messageTemplate == nullptr) { + return nullptr; //Y_FAIL("unknown message type: %d", unsigned(messageType)); } @@ -82,7 +82,7 @@ TAutoPtr<TBusMessage> TBusBufferProtocol::Deserialize(ui16 messageType, TArrayRe bool ok = bmess->GetRecord()->ParseFromCodedStream(&input) && input.ConsumedEntireMessage(); if (!ok) { - return nullptr; + return nullptr; } return bmess.Release(); } diff --git a/library/cpp/messagebus/rain_check/core/coro.h b/library/cpp/messagebus/rain_check/core/coro.h index 95e2a30f9b..5d77e8b55b 100644 --- a/library/cpp/messagebus/rain_check/core/coro.h +++ b/library/cpp/messagebus/rain_check/core/coro.h @@ -22,14 +22,14 @@ namespace NRainCheck { public: TCoroTaskRunner(IEnv* env, ISubtaskListener* parent, TAutoPtr<ICoroTask> impl); - ~TCoroTaskRunner() override; + ~TCoroTaskRunner() override; private: static TContClosure ContClosure(TCoroTaskRunner* runner, TArrayRef<char> memRegion); - bool ReplyReceived() override /* override */; + bool ReplyReceived() override /* override */; - void DoRun() override /* override */; + void DoRun() override /* override */; ICoroTask* GetImpl() { return (ICoroTask*)GetImplBase(); diff --git a/library/cpp/messagebus/rain_check/core/coro_ut.cpp b/library/cpp/messagebus/rain_check/core/coro_ut.cpp index 61a33584a5..b0a9d47fbf 100644 --- a/library/cpp/messagebus/rain_check/core/coro_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/coro_ut.cpp @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { { } - void Run() override { + void Run() override { TestSync->WaitForAndIncrement(0); } }; @@ -42,7 +42,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { TSubtaskCompletion SleepCompletion; - void Run() override { + void Run() override { Env->SleepService.Sleep(&SleepCompletion, TDuration::MilliSeconds(1)); WaitForSubtasks(); TestSync->WaitForAndIncrement(0); @@ -69,7 +69,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { { } - void Run() override { + void Run() override { TestSync->CheckAndIncrement(1); } }; @@ -86,7 +86,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { TSubtaskCompletion SubtaskCompletion; - void Run() override { + void Run() override { TestSync->CheckAndIncrement(0); SpawnSubtask<TSubtask>(Env, &SubtaskCompletion, TestSync); WaitForSubtasks(); diff --git a/library/cpp/messagebus/rain_check/core/simple.h b/library/cpp/messagebus/rain_check/core/simple.h index 20e1bf19f5..06890b8443 100644 --- a/library/cpp/messagebus/rain_check/core/simple.h +++ b/library/cpp/messagebus/rain_check/core/simple.h @@ -14,12 +14,12 @@ namespace NRainCheck { public: TContinueFunc() - : Func(nullptr) + : Func(nullptr) { } TContinueFunc(void*) - : Func(nullptr) + : Func(nullptr) { } @@ -38,13 +38,13 @@ namespace NRainCheck { class TSimpleTaskRunner: public TTaskRunnerBase { public: TSimpleTaskRunner(IEnv* env, ISubtaskListener* parentTask, TAutoPtr<ISimpleTask>); - ~TSimpleTaskRunner() override; + ~TSimpleTaskRunner() override; private: // Function to be called on completion of all pending tasks. TContinueFunc ContinueFunc; - bool ReplyReceived() override /* override */; + bool ReplyReceived() override /* override */; ISimpleTask* GetImpl() { return (ISimpleTask*)GetImplBase(); diff --git a/library/cpp/messagebus/rain_check/core/simple_ut.cpp b/library/cpp/messagebus/rain_check/core/simple_ut.cpp index d4545e05aa..98b4b9bd52 100644 --- a/library/cpp/messagebus/rain_check/core/simple_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/simple_ut.cpp @@ -21,7 +21,7 @@ Y_UNIT_TEST_SUITE(RainCheckSimple) { TSubtaskCompletion SleepCompletion; - TContinueFunc Start() override { + TContinueFunc Start() override { TestSync->CheckAndIncrement(0); Env->SleepService.Sleep(&SleepCompletion, TDuration::MilliSeconds(1)); @@ -44,7 +44,7 @@ Y_UNIT_TEST_SUITE(RainCheckSimple) { TContinueFunc Last() { TestSync->CheckAndIncrement(3); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/core/sleep.cpp b/library/cpp/messagebus/rain_check/core/sleep.cpp index f5d0b4cac9..ae38d8017c 100644 --- a/library/cpp/messagebus/rain_check/core/sleep.cpp +++ b/library/cpp/messagebus/rain_check/core/sleep.cpp @@ -34,7 +34,7 @@ namespace { { } - void Do() override { + void Do() override { Parent->SetDone(); } }; diff --git a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp index 2ae85a87b1..da00dee153 100644 --- a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp @@ -20,7 +20,7 @@ Y_UNIT_TEST_SUITE(Sleep) { TSubtaskCompletion Sleep; - TContinueFunc Start() override { + TContinueFunc Start() override { Env->SleepService.Sleep(&Sleep, TDuration::MilliSeconds(1)); TestSync->CheckAndIncrement(0); @@ -30,7 +30,7 @@ Y_UNIT_TEST_SUITE(Sleep) { TContinueFunc Continue() { TestSync->CheckAndIncrement(1); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp index ba5a5e41cf..acfa11ded9 100644 --- a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp @@ -26,7 +26,7 @@ Y_UNIT_TEST_SUITE(Spawn) { unsigned I; - TContinueFunc Start() override { + TContinueFunc Start() override { if (I < 4) { I += 1; return &TTestTask::Start; @@ -39,7 +39,7 @@ Y_UNIT_TEST_SUITE(Spawn) { TestSync->CheckAndIncrement(1); Started.Signal(); - return nullptr; + return nullptr; } }; @@ -63,10 +63,10 @@ Y_UNIT_TEST_SUITE(Spawn) { { } - TContinueFunc Start() override { + TContinueFunc Start() override { Sleep(TDuration::MilliSeconds(1)); TestSync->CheckAndIncrement(1); - return nullptr; + return nullptr; } }; @@ -82,7 +82,7 @@ Y_UNIT_TEST_SUITE(Spawn) { TSubtaskCompletion SubtaskCompletion; - TContinueFunc Start() override { + TContinueFunc Start() override { TestSync->CheckAndIncrement(0); SpawnSubtask<TSubtask>(Env, &SubtaskCompletion, TestSync); return &TSpawnTask::Continue; @@ -90,7 +90,7 @@ Y_UNIT_TEST_SUITE(Spawn) { TContinueFunc Continue() { TestSync->CheckAndIncrement(2); - return nullptr; + return nullptr; } }; @@ -118,10 +118,10 @@ Y_UNIT_TEST_SUITE(Spawn) { std::array<TSubtaskCompletion, 3> Subtasks; - TContinueFunc Start() override { + TContinueFunc Start() override { if (I == 1000) { TestSync->CheckAndIncrement(0); - return nullptr; + return nullptr; } for (auto& subtask : Subtasks) { diff --git a/library/cpp/messagebus/rain_check/core/task.cpp b/library/cpp/messagebus/rain_check/core/task.cpp index a098437d53..0cd209f44f 100644 --- a/library/cpp/messagebus/rain_check/core/task.cpp +++ b/library/cpp/messagebus/rain_check/core/task.cpp @@ -153,7 +153,7 @@ void TSubtaskCompletion::SetRunning(TTaskRunnerBase* parent) { void TSubtaskCompletion::SetDone() { Y_ASSERT(!!TaskRunner); TTaskRunnerBase* temp = TaskRunner; - TaskRunner = nullptr; + TaskRunner = nullptr; for (;;) { ESubtaskState state = State.Get(); @@ -212,5 +212,5 @@ TString TTaskRunnerBase::GetStatusSingleLine() { } bool NRainCheck::AreWeInsideTask() { - return ThreadCurrentTask != nullptr; + return ThreadCurrentTask != nullptr; } diff --git a/library/cpp/messagebus/rain_check/core/task.h b/library/cpp/messagebus/rain_check/core/task.h index 7d8778bcda..5da3136b23 100644 --- a/library/cpp/messagebus/rain_check/core/task.h +++ b/library/cpp/messagebus/rain_check/core/task.h @@ -19,7 +19,7 @@ namespace NRainCheck { }; struct TNopSubtaskListener: public ISubtaskListener { - void SetDone() override; + void SetDone() override; static TNopSubtaskListener Instance; }; @@ -32,12 +32,12 @@ namespace NRainCheck { public: TSubtaskCompletionFunc() - : Func(nullptr) + : Func(nullptr) { } TSubtaskCompletionFunc(void*) - : Func(nullptr) + : Func(nullptr) { } @@ -84,7 +84,7 @@ namespace NRainCheck { , TaskRunner() { } - ~TSubtaskCompletion() override; + ~TSubtaskCompletion() override; // Either done or cancel requested or cancelled bool IsComplete() const { @@ -124,7 +124,7 @@ namespace NRainCheck { // called by service provider implementations // must not be called by actor void SetRunning(TTaskRunnerBase* parent); - void SetDone() override; + void SetDone() override; }; // See ISimpleTask, ICoroTask @@ -151,7 +151,7 @@ namespace NRainCheck { public: // Construct task. Task is not automatically started. TTaskRunnerBase(IEnv*, ISubtaskListener* parent, TAutoPtr<ITaskBase> impl); - ~TTaskRunnerBase() override; + ~TTaskRunnerBase() override; bool IsRunningInThisThread() const; void AssertInThisThread() const; diff --git a/library/cpp/messagebus/rain_check/core/track.h b/library/cpp/messagebus/rain_check/core/track.h index d387de7574..90993c128f 100644 --- a/library/cpp/messagebus/rain_check/core/track.h +++ b/library/cpp/messagebus/rain_check/core/track.h @@ -29,7 +29,7 @@ namespace NRainCheck { { } - void SetDone() override; + void SetDone() override; TString GetStatusSingleLine(); }; @@ -61,7 +61,7 @@ namespace NRainCheck { public: TTaskTracker(NActor::TExecutor* executor); - ~TTaskTracker() override; + ~TTaskTracker() override; void Shutdown(); @@ -83,7 +83,7 @@ namespace NRainCheck { { } - TIntrusivePtr<TTaskRunnerBase> NewTask(ISubtaskListener* subtaskListener) override { + TIntrusivePtr<TTaskRunnerBase> NewTask(ISubtaskListener* subtaskListener) override { return NRainCheck::SpawnTask<TTask>(Env, Param, subtaskListener).Get(); } }; diff --git a/library/cpp/messagebus/rain_check/core/track_ut.cpp b/library/cpp/messagebus/rain_check/core/track_ut.cpp index 05f7de1319..86f6f60416 100644 --- a/library/cpp/messagebus/rain_check/core/track_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/track_ut.cpp @@ -16,10 +16,10 @@ Y_UNIT_TEST_SUITE(TaskTracker) { { } - TContinueFunc Start() override { + TContinueFunc Start() override { TestSync->WaitForAndIncrement(0); TestSync->WaitForAndIncrement(2); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp index daac8d9a99..bd7d7cb13a 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp @@ -37,7 +37,7 @@ void TBusClientService::ProcessResultCommon(NBus::TBusMessageAutoPtr message, return; } - future->SetDoneAndSchedule(status, nullptr); + future->SetDoneAndSchedule(status, nullptr); } void TBusClientService::SendOneWay( @@ -76,19 +76,19 @@ void NRainCheck::TBusClientService::OnMessageSentOneWay( TBusFuture* future = (TBusFuture*)request->Data; Y_ASSERT(future->Request.Get() == request.Get()); Y_UNUSED(request.Release()); - future->SetDoneAndSchedule(MESSAGE_OK, nullptr); + future->SetDoneAndSchedule(MESSAGE_OK, nullptr); } void TBusClientService::OnError( TAutoPtr<TBusMessage> message, NBus::EMessageStatus status) { - if (message->Data == nullptr) { + if (message->Data == nullptr) { return; } TBusFuture* future = (TBusFuture*)message->Data; Y_ASSERT(future->Request.Get() == message.Get()); Y_UNUSED(message.Release()); - future->SetDoneAndSchedule(status, nullptr); + future->SetDoneAndSchedule(status, nullptr); } void TBusFuture::SetDoneAndSchedule(EMessageStatus status, TAutoPtr<TBusMessage> response) { diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h index 0a291cdea6..251eae5738 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h @@ -47,7 +47,7 @@ namespace NRainCheck { public: TBusClientService(const NBus::TBusSessionConfig&, NBus::TBusProtocol*, NBus::TBusMessageQueue*); - ~TBusClientService() override; + ~TBusClientService() override; void Send(NBus::TBusMessageAutoPtr, const NBus::TNetAddr&, TBusFuture* future); void SendOneWay(NBus::TBusMessageAutoPtr, const NBus::TNetAddr&, TBusFuture* future); @@ -59,9 +59,9 @@ namespace NRainCheck { void SendCommon(NBus::TBusMessage*, const NBus::TNetAddr&, TBusFuture* future); void ProcessResultCommon(NBus::TBusMessageAutoPtr, const NBus::TNetAddr&, TBusFuture* future, NBus::EMessageStatus); - void OnReply(TAutoPtr<NBus::TBusMessage> pMessage, TAutoPtr<NBus::TBusMessage> pReply) override; - void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; - void OnMessageSentOneWay(TAutoPtr<NBus::TBusMessage>) override; + void OnReply(TAutoPtr<NBus::TBusMessage> pMessage, TAutoPtr<NBus::TBusMessage> pReply) override; + void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; + void OnMessageSentOneWay(TAutoPtr<NBus::TBusMessage>) override; }; } diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp index 1b3618558b..f65e8b382c 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp @@ -46,7 +46,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { TVector<TSimpleSharedPtr<TBusFuture>> Requests; - TContinueFunc Start() override { + TContinueFunc Start() override { for (unsigned i = 0; i < 3; ++i) { Requests.push_back(new TBusFuture); TNetAddr addr("localhost", ServerPort); @@ -62,7 +62,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { VerifyDynamicCast<TExampleResponse*>(Requests[i]->GetResponse()); } Env->TestSync.CheckAndIncrement(0); - return nullptr; + return nullptr; } }; @@ -91,7 +91,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { Session = Queue->CreateDestination(&Proto, this, NBus::TBusSessionConfig()); } - void OnMessage(NBus::TOnMessageContext& context) override { + void OnMessage(NBus::TOnMessageContext& context) override { TestSync->CheckAndIncrement(1); context.ForgetRequest(); } @@ -110,7 +110,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { TVector<TSimpleSharedPtr<TBusFuture>> Requests; - TContinueFunc Start() override { + TContinueFunc Start() override { Env->TestSync.CheckAndIncrement(0); for (unsigned i = 0; i < 1; ++i) { @@ -128,7 +128,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { Y_VERIFY(!Requests[i]->GetResponse()); } Env->TestSync.WaitForAndIncrement(2); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h index 1334f05fe4..ec7a883d32 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h @@ -18,11 +18,11 @@ namespace NRainCheck { THolder<ITaskFactory> TaskFactory; - void OnMessage(NBus::TOnMessageContext&) override; + void OnMessage(NBus::TOnMessageContext&) override; public: TBusTaskStarter(TAutoPtr<ITaskFactory>); - ~TBusTaskStarter() override; + ~TBusTaskStarter() override; public: template <typename TTask, typename TEnv> @@ -35,7 +35,7 @@ namespace NRainCheck { { } - void NewTask(NBus::TOnMessageContext& context) override { + void NewTask(NBus::TOnMessageContext& context) override { SpawnTask<TTask, TEnv, NBus::TOnMessageContext&>(Env, context); } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp index 7c11399f1b..32c131798b 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp @@ -27,9 +27,9 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusServer) { MessageContext.Swap(messageContext); } - TContinueFunc Start() override { + TContinueFunc Start() override { MessageContext.SendReplyMove(new TExampleResponse(&Env->Proto.ResponseCount)); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/test/helper/misc.cpp b/library/cpp/messagebus/rain_check/test/helper/misc.cpp index c0fcb27252..e07fc7e3cc 100644 --- a/library/cpp/messagebus/rain_check/test/helper/misc.cpp +++ b/library/cpp/messagebus/rain_check/test/helper/misc.cpp @@ -23,5 +23,5 @@ TContinueFunc TSpawnNopTasksSimpleTask::Start() { } TContinueFunc TSpawnNopTasksSimpleTask::Join() { - return nullptr; + return nullptr; } diff --git a/library/cpp/messagebus/rain_check/test/helper/misc.h b/library/cpp/messagebus/rain_check/test/helper/misc.h index 9150be4d2f..ba95ee5f23 100644 --- a/library/cpp/messagebus/rain_check/test/helper/misc.h +++ b/library/cpp/messagebus/rain_check/test/helper/misc.h @@ -9,8 +9,8 @@ namespace NRainCheck { TNopSimpleTask(IEnv*, const void*) { } - TContinueFunc Start() override { - return nullptr; + TContinueFunc Start() override { + return nullptr; } }; @@ -34,7 +34,7 @@ namespace NRainCheck { std::array<TSubtaskCompletion, 2> Completion; - void Run() override; + void Run() override; }; struct TSpawnNopTasksSimpleTask: public ISimpleTask { @@ -49,7 +49,7 @@ namespace NRainCheck { std::array<TSubtaskCompletion, 2> Completion; - TContinueFunc Start() override; + TContinueFunc Start() override; TContinueFunc Join(); }; diff --git a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp index 22edbd8c6b..e19dea5561 100644 --- a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp @@ -28,7 +28,7 @@ struct TCoroOuter: public ICoroTask { { } - void Run() override { + void Run() override { for (;;) { TInstant start = TInstant::Now(); @@ -73,7 +73,7 @@ struct TSimpleOuter: public ISimpleTask { unsigned Current; unsigned I; - TContinueFunc Start() override { + TContinueFunc Start() override { StartInstant = TInstant::Now(); Count = 0; Current = 1000; @@ -126,7 +126,7 @@ struct TReproduceCrashTask: public ISimpleTask { std::array<TSubtaskCompletion, SUBTASKS> Completion; - TContinueFunc Start() override { + TContinueFunc Start() override { for (unsigned j = 0; j < 2; ++j) { //SpawnSubtask<TNopSimpleTask>(Env, &Completion[j]); SpawnSubtask<TSpawnNopTasksSimpleTask>(Env, &Completion[j], SUBTASKS); diff --git a/library/cpp/messagebus/scheduler/scheduler_ut.cpp b/library/cpp/messagebus/scheduler/scheduler_ut.cpp index a5ea641c10..4773d0d6e2 100644 --- a/library/cpp/messagebus/scheduler/scheduler_ut.cpp +++ b/library/cpp/messagebus/scheduler/scheduler_ut.cpp @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TSchedulerTests) { { } - void Do() override { + void Do() override { TestSync->WaitForAndIncrement(0); } }; diff --git a/library/cpp/messagebus/session_impl.cpp b/library/cpp/messagebus/session_impl.cpp index ddf9f360c4..ffd6313405 100644 --- a/library/cpp/messagebus/session_impl.cpp +++ b/library/cpp/messagebus/session_impl.cpp @@ -25,7 +25,7 @@ namespace { { } - void Do() override { + void Do() override { TIntrusivePtr<TBusSession> session = Session.Get(); if (!!session) { SessionImpl->Cron(); @@ -579,7 +579,7 @@ TRemoteConnectionPtr TBusSessionImpl::GetConnectionById(ui64 id) { THashMap<ui64, TRemoteConnectionPtr>::const_iterator it = ConnectionsById.find(id); if (it == ConnectionsById.end()) { - return nullptr; + return nullptr; } else { return it->second; } @@ -594,7 +594,7 @@ TAcceptorPtr TBusSessionImpl::GetAcceptorById(ui64 id) { } } - return nullptr; + return nullptr; } void TBusSessionImpl::InvokeOnError(TNonDestroyingAutoPtr<TBusMessage> message, EMessageStatus status) { diff --git a/library/cpp/messagebus/synchandler.cpp b/library/cpp/messagebus/synchandler.cpp index 8e891d66b3..5198eaadd5 100644 --- a/library/cpp/messagebus/synchandler.cpp +++ b/library/cpp/messagebus/synchandler.cpp @@ -19,7 +19,7 @@ struct TBusSyncMessageData { EMessageStatus ReplyStatus; TBusSyncMessageData() - : Reply(nullptr) + : Reply(nullptr) , ReplyStatus(MESSAGE_DONT_ASK) { } @@ -29,13 +29,13 @@ class TSyncHandler: public IBusClientHandler { public: TSyncHandler(bool expectReply = true) : ExpectReply(expectReply) - , Session(nullptr) + , Session(nullptr) { } ~TSyncHandler() override { } - void OnReply(TAutoPtr<TBusMessage> pMessage0, TAutoPtr<TBusMessage> pReply0) override { + void OnReply(TAutoPtr<TBusMessage> pMessage0, TAutoPtr<TBusMessage> pReply0) override { TBusMessage* pMessage = pMessage0.Release(); TBusMessage* pReply = pReply0.Release(); @@ -47,25 +47,25 @@ public: SignalResult(data, pReply, MESSAGE_OK); } - void OnError(TAutoPtr<TBusMessage> pMessage0, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> pMessage0, EMessageStatus status) override { TBusMessage* pMessage = pMessage0.Release(); TBusSyncMessageData* data = static_cast<TBusSyncMessageData*>(pMessage->Data); if (!data) { return; } - SignalResult(data, /*pReply=*/nullptr, status); + SignalResult(data, /*pReply=*/nullptr, status); } - void OnMessageSent(TBusMessage* pMessage) override { + void OnMessageSent(TBusMessage* pMessage) override { Y_UNUSED(pMessage); Y_ASSERT(ExpectReply); } - void OnMessageSentOneWay(TAutoPtr<TBusMessage> pMessage) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage> pMessage) override { Y_ASSERT(!ExpectReply); TBusSyncMessageData* data = static_cast<TBusSyncMessageData*>(pMessage.Release()->Data); - SignalResult(data, /*pReply=*/nullptr, MESSAGE_OK); + SignalResult(data, /*pReply=*/nullptr, MESSAGE_OK); } void SetSession(TRemoteClientSession* session) { diff --git a/library/cpp/messagebus/test/example/client/client.cpp b/library/cpp/messagebus/test/example/client/client.cpp index 89b5f2c9be..b61bfb1a6e 100644 --- a/library/cpp/messagebus/test/example/client/client.cpp +++ b/library/cpp/messagebus/test/example/client/client.cpp @@ -18,11 +18,11 @@ namespace NCalculator { ClientSession = TBusClientSession::Create(&Proto, this, config, MessageQueue); } - ~TCalculatorClient() override { + ~TCalculatorClient() override { MessageQueue->Stop(); } - void OnReply(TAutoPtr<TBusMessage> request, TAutoPtr<TBusMessage> response0) override { + void OnReply(TAutoPtr<TBusMessage> request, TAutoPtr<TBusMessage> response0) override { Y_VERIFY(response0->GetHeader()->Type == TResponse::MessageType, "wrong response"); TResponse* response = VerifyDynamicCast<TResponse*>(response0.Get()); if (request->GetHeader()->Type == TRequestSum::MessageType) { @@ -40,7 +40,7 @@ namespace NCalculator { } } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { Cerr << "got error " << status << "\n"; } }; diff --git a/library/cpp/messagebus/test/example/server/server.cpp b/library/cpp/messagebus/test/example/server/server.cpp index 13e52d75f5..b7e1045782 100644 --- a/library/cpp/messagebus/test/example/server/server.cpp +++ b/library/cpp/messagebus/test/example/server/server.cpp @@ -15,11 +15,11 @@ namespace NCalculator { ServerSession = TBusServerSession::Create(&Proto, this, config, MessageQueue); } - ~TCalculatorServer() override { + ~TCalculatorServer() override { MessageQueue->Stop(); } - void OnMessage(TOnMessageContext& request) override { + void OnMessage(TOnMessageContext& request) override { if (request.GetMessage()->GetHeader()->Type == TRequestSum::MessageType) { TRequestSum* requestSum = VerifyDynamicCast<TRequestSum*>(request.GetMessage()); int a = requestSum->Record.GetA(); diff --git a/library/cpp/messagebus/test/helper/example.cpp b/library/cpp/messagebus/test/helper/example.cpp index 7c6d704042..b76fcbbe5f 100644 --- a/library/cpp/messagebus/test/helper/example.cpp +++ b/library/cpp/messagebus/test/helper/example.cpp @@ -100,7 +100,7 @@ TAutoPtr<TBusMessage> TExampleProtocol::Deserialize(ui16 messageType, TArrayRef< exampleReply->Data.append(payload.data(), payload.size()); return exampleReply; } else { - return nullptr; + return nullptr; } } diff --git a/library/cpp/messagebus/test/helper/example_module.cpp b/library/cpp/messagebus/test/helper/example_module.cpp index 65ecfcf73f..3f040b37c9 100644 --- a/library/cpp/messagebus/test/helper/example_module.cpp +++ b/library/cpp/messagebus/test/helper/example_module.cpp @@ -22,7 +22,7 @@ bool TExampleModule::Shutdown() { } TBusServerSessionPtr TExampleModule::CreateExtSession(TBusMessageQueue&) { - return nullptr; + return nullptr; } TBusServerSessionPtr TExampleServerModule::CreateExtSession(TBusMessageQueue& queue) { @@ -39,5 +39,5 @@ TExampleClientModule::TExampleClientModule() TBusServerSessionPtr TExampleClientModule::CreateExtSession(TBusMessageQueue& queue) { Source = CreateDefaultSource(queue, &Proto, TBusServerSessionConfig()); Source->RegisterService("localhost"); - return nullptr; + return nullptr; } diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp index 8489319278..20ac0e2015 100644 --- a/library/cpp/messagebus/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/test/perftest/perftest.cpp @@ -294,7 +294,7 @@ public: } /// actual work is being done here - void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { + void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { Y_UNUSED(mess); if (Config.SimpleProtocol) { @@ -309,7 +309,7 @@ public: } /// message that could not be delivered - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_UNUSED(status); @@ -372,7 +372,7 @@ public: } /// when message comes, send reply - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { if (Config.SimpleProtocol) { TSimpleMessage* typed = VerifyDynamicCast<TSimpleMessage*>(mess.GetMessage()); TAutoPtr<TSimpleMessage> response(new TSimpleMessage); @@ -425,7 +425,7 @@ public: } private: - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { TPerftestRequest* typed = VerifyDynamicCast<TPerftestRequest*>(mess); CheckRequest(typed); @@ -436,14 +436,14 @@ private: /// forget replies for few messages, see what happends if (TheConfig->Failure > RandomNumber<double>()) { - return nullptr; + return nullptr; } job->SendReply(NewResponse(typed).Release()); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { return Session = CreateDefaultDestination(queue, Proto.Get(), Config.ServerSessionConfig); } }; @@ -459,7 +459,7 @@ static TNetworkAddress ParseNetworkAddress(const char* string) { const char* port = strchr(string, ':'); - if (port != nullptr) { + if (port != nullptr) { Name.append(string, port - string); Port = atoi(port + 1); } else { @@ -591,8 +591,8 @@ int main(int argc, char* argv[]) { NLWTrace::StartLwtraceFromEnv(); /* unix foo */ - setvbuf(stdout, nullptr, _IONBF, 0); - setvbuf(stderr, nullptr, _IONBF, 0); + setvbuf(stdout, nullptr, _IONBF, 0); + setvbuf(stderr, nullptr, _IONBF, 0); Umask(0); SetAsyncSignalHandler(SIGINT, stopsignal); SetAsyncSignalHandler(SIGTERM, stopsignal); diff --git a/library/cpp/messagebus/test/perftest/simple_proto.cpp b/library/cpp/messagebus/test/perftest/simple_proto.cpp index 19d6c15b9d..b50659d794 100644 --- a/library/cpp/messagebus/test/perftest/simple_proto.cpp +++ b/library/cpp/messagebus/test/perftest/simple_proto.cpp @@ -14,7 +14,7 @@ void TSimpleProtocol::Serialize(const TBusMessage* mess, TBuffer& data) { TAutoPtr<TBusMessage> TSimpleProtocol::Deserialize(ui16, TArrayRef<const char> payload) { if (payload.size() != 4) { - return nullptr; + return nullptr; } TAutoPtr<TSimpleMessage> r(new TSimpleMessage); memcpy(&r->Payload, payload.data(), 4); diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp index 040f9b7702..26db074861 100644 --- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp +++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp @@ -30,7 +30,7 @@ namespace { Session->Shutdown(); } - void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { + void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { Y_VERIFY(AtomicGet(SentCompleted), "must be completed"); TExampleClient::OnReply(mess, reply); @@ -38,7 +38,7 @@ namespace { ReplyReceived.Signal(); } - void OnMessageSent(TBusMessage*) override { + void OnMessageSent(TBusMessage*) override { Sleep(TDuration::MilliSeconds(100)); AtomicSet(SentCompleted, 1); } @@ -259,13 +259,13 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { { } - ~TSendTimeoutCheckerExampleClient() override { + ~TSendTimeoutCheckerExampleClient() override { Session->Shutdown(); } TSystemEvent ErrorHappened; - void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data()); ErrorHappened.Signal(); } @@ -326,7 +326,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { } } - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { Y_VERIFY(mess.IsConnectionAlive(), "connection should be alive here"); TAutoPtr<TOnMessageContext> delayedMsg(new TOnMessageContext); delayedMsg->Swap(mess); @@ -376,7 +376,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { return DelayedMessages.size(); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data()); } @@ -418,7 +418,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session = TBusServerSession::Create(&Proto, this, sessionConfig, Bus); } - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { TBusIdentity ident; mess.AckMessage(ident); @@ -430,7 +430,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { mess.GetSession()->SendReply(resurrected, new TExampleResponse(&Proto.ResponseCount)); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed"); } @@ -488,7 +488,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { TAutoPtr<TBusMessage> response; if (TestSync.Get() == 0) { @@ -502,7 +502,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { mess.SendReplyMove(response); } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { TestSync.WaitForAndIncrement(1); Y_VERIFY(status == MESSAGE_MESSAGE_TOO_LARGE, "status"); @@ -548,7 +548,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessage(TOnMessageContext& req) override { + void OnMessage(TOnMessageContext& req) override { unsigned n = TestSync.Get(); if (n < 2) { TestSync.CheckAndIncrement(n); @@ -695,7 +695,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { TestSync.WaitForAndIncrement(0); Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data()); mess.Destroy(); @@ -723,7 +723,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override { TestSync.CheckAndIncrement(0); Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data()); @@ -777,7 +777,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessageSentOneWay(TAutoPtr<TBusMessage> sent) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage> sent) override { TestSync.WaitForAndIncrement(0); sent->Reset(); TestSync.CheckAndIncrement(1); @@ -889,7 +889,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnClientConnectionEvent(const TClientConnectionEvent& event) override { + void OnClientConnectionEvent(const TClientConnectionEvent& event) override { if (Sync.Get() > 2) { // Test OnClientConnectionEvent_Disconnect is broken. // Sometimes reconnect happens during server shutdown @@ -905,11 +905,11 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { } } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { // We do not check for message errors in this test. } - void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { } }; @@ -923,7 +923,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { // We do not check for server message errors in this test. } }; @@ -988,7 +988,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessage(TOnMessageContext& req) override { + void OnMessage(TOnMessageContext& req) override { if (!GoOn.Wait(0)) { TGuard<TMutex> guard(OneLock); diff --git a/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp b/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp index 4083cf3b7b..8cbef0b4a5 100644 --- a/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp @@ -25,7 +25,7 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { ServerSession = TBusServerSession::Create(&Proto, this, TBusServerSessionConfig(), Queue); } - void OnMessage(TOnMessageContext& context) override { + void OnMessage(TOnMessageContext& context) override { TestSync->WaitForAndIncrement(1); context.ForgetRequest(); } @@ -46,7 +46,7 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { { } - TJobHandler Start(TBusJob* job, TBusMessage*) override { + TJobHandler Start(TBusJob* job, TBusMessage*) override { TestSync->WaitForAndIncrement(0); job->SendOneWayTo(new TExampleRequest(&Proto.RequestCount), ClientSession.Get(), TNetAddr("localhost", Port)); @@ -57,12 +57,12 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { TJobHandler Sent(TBusJob* job, TBusMessage*) { TestSync->WaitForAndIncrement(2); job->Cancel(MESSAGE_DONT_ASK); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { ClientSession = CreateDefaultSource(queue, &Proto, TBusServerSessionConfig()); - return nullptr; + return nullptr; } }; @@ -97,7 +97,7 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { { } - TJobHandler Start(TBusJob* job, TBusMessage*) override { + TJobHandler Start(TBusJob* job, TBusMessage*) override { TestSync->WaitForAndIncrement(0); job->SendOneWayTo(new TExampleRequest(&Proto.RequestCount), ClientSession.Get(), TNetAddr("localhost", 1)); @@ -108,17 +108,17 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { TJobHandler Sent(TBusJob* job, TBusMessage*) { TestSync->WaitForAndIncrement(1); job->Cancel(MESSAGE_DONT_ASK); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { TBusServerSessionConfig sessionConfig; sessionConfig.ConnectTimeout = 1; sessionConfig.SendTimeout = 1; sessionConfig.TotalTimeout = 1; sessionConfig.Secret.TimeoutPeriod = TDuration::MilliSeconds(1); ClientSession = CreateDefaultSource(queue, &Proto, sessionConfig); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/test/ut/module_client_ut.cpp b/library/cpp/messagebus/test/ut/module_client_ut.cpp index ebfe185cc6..ef446dd7e2 100644 --- a/library/cpp/messagebus/test/ut/module_client_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_ut.cpp @@ -111,7 +111,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); job->Send(new TExampleRequest(&Proto.RequestCount), Source, TReplyHandler(&TParallelOnReplyModule::ReplyHandler), 0, ServerAddr); return &TParallelOnReplyModule::HandleReplies; @@ -128,7 +128,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { RepliesLatch.CountDown(); Y_VERIFY(RepliesLatch.Await(TDuration::Seconds(10)), "failed to get answers"); job->Cancel(MESSAGE_UNKNOWN); - return nullptr; + return nullptr; } }; @@ -169,7 +169,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); TExampleRequest* message = new TExampleRequest(&Proto.RequestCount); job->Send(message, Source, TReplyHandler(&TErrorHandlerCheckerModule::ReplyHandler), 0, ServerAddr); @@ -188,16 +188,16 @@ Y_UNIT_TEST_SUITE(BusJobTest) { Y_UNUSED(mess); job->Cancel(MESSAGE_UNKNOWN); GotReplyLatch.CountDown(); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { TBusClientSessionConfig sessionConfig; sessionConfig.SendTimeout = 1; // TODO: allow 0 sessionConfig.Secret.TimeoutPeriod = TDuration::MilliSeconds(10); Source = CreateDefaultSource(queue, &Proto, sessionConfig); Source->RegisterService("localhost"); - return nullptr; + return nullptr; } }; @@ -239,7 +239,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { ServerSession = TBusServerSession::Create(&Proto, this, sessionConfig, Bus); } - void OnMessage(TOnMessageContext& req) override { + void OnMessage(TOnMessageContext& req) override { if (AtomicIncrement(OnMessageCount) == 1) { TestSync->WaitForAndIncrement(0); } @@ -258,12 +258,12 @@ Y_UNIT_TEST_SUITE(BusJobTest) { TModuleThatSendsReplyEarly(TTestSync* testSync, unsigned serverPort) : TestSync(testSync) , ServerPort(serverPort) - , ServerSession(nullptr) + , ServerSession(nullptr) , ReplyCount(0) { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); for (unsigned i = 0; i < 2; ++i) { job->Send( @@ -291,10 +291,10 @@ Y_UNIT_TEST_SUITE(BusJobTest) { TJobHandler HandleReplies(TBusJob* job, TBusMessage* mess) { Y_UNUSED(mess); job->Cancel(MESSAGE_UNKNOWN); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { TExampleClientModule::CreateExtSession(queue); TBusServerSessionConfig sessionConfig; return ServerSession = CreateDefaultDestination(queue, &Proto, sessionConfig); @@ -328,7 +328,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage*) override { + TJobHandler Start(TBusJob* job, TBusMessage*) override { TestSync.CheckAndIncrement(0); job->Send(new TExampleRequest(&Proto.RequestCount), Source, @@ -345,7 +345,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { TJobHandler End(TBusJob* job, TBusMessage*) { TestSync.CheckAndIncrement(2); job->Cancel(MESSAGE_SHUTDOWN); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/test/ut/module_server_ut.cpp b/library/cpp/messagebus/test/ut/module_server_ut.cpp index 88fe1dd9b6..b96479af71 100644 --- a/library/cpp/messagebus/test/ut/module_server_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_server_ut.cpp @@ -47,14 +47,14 @@ Y_UNIT_TEST_SUITE(ModuleServerTests) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { WaitTwoRequestsLatch.CountDown(); Y_VERIFY(WaitTwoRequestsLatch.Await(TDuration::Seconds(5)), "oops"); VerifyDynamicCast<TExampleRequest*>(mess); job->SendReply(new TExampleResponse(&Proto.ResponseCount)); - return nullptr; + return nullptr; } }; @@ -78,7 +78,7 @@ Y_UNIT_TEST_SUITE(ModuleServerTests) { TSystemEvent MessageReceivedEvent; TSystemEvent ClientDiedEvent; - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); MessageReceivedEvent.Signal(); @@ -86,7 +86,7 @@ Y_UNIT_TEST_SUITE(ModuleServerTests) { Y_VERIFY(ClientDiedEvent.WaitT(TDuration::Seconds(5)), "oops"); job->SendReply(new TExampleResponse(&Proto.ResponseCount)); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/test/ut/one_way_ut.cpp b/library/cpp/messagebus/test/ut/one_way_ut.cpp index 9c21227e2b..057c0de406 100644 --- a/library/cpp/messagebus/test/ut/one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/one_way_ut.cpp @@ -79,7 +79,7 @@ struct NullClient : TBusClientHandlerError { } } - void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { } }; @@ -111,7 +111,7 @@ public: } /// when message comes do not send reply, just acknowledge - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { TExampleRequest* fmess = static_cast<TExampleRequest*>(mess.GetMessage()); Y_ASSERT(fmess->Data == "TADA"); @@ -123,7 +123,7 @@ public: } /// this handler should not be called because this server does not send replies - void OnSent(TAutoPtr<TBusMessage> mess) override { + void OnSent(TAutoPtr<TBusMessage> mess) override { Y_UNUSED(mess); Y_FAIL("This server does not sent replies"); } @@ -161,11 +161,11 @@ Y_UNIT_TEST_SUITE(TMessageBusTests_OneWay) { { } - ~TMessageTooLargeClient() override { + ~TMessageTooLargeClient() override { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_VERIFY(status == MESSAGE_MESSAGE_TOO_LARGE, "wrong status: %s", ToCString(status)); @@ -188,7 +188,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests_OneWay) { } struct TCheckTimeoutClient: public NullClient { - ~TCheckTimeoutClient() override { + ~TCheckTimeoutClient() override { Session->Shutdown(); } @@ -208,7 +208,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests_OneWay) { TSystemEvent GotError; /// message that could not be delivered - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_UNUSED(status); // TODO: check status diff --git a/library/cpp/messagebus/test/ut/starter_ut.cpp b/library/cpp/messagebus/test/ut/starter_ut.cpp index dd4d3aaa5e..c738b16eb5 100644 --- a/library/cpp/messagebus/test/ut/starter_ut.cpp +++ b/library/cpp/messagebus/test/ut/starter_ut.cpp @@ -18,7 +18,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); AtomicIncrement(StartCount); job->Sleep(10); @@ -29,7 +29,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { Y_UNUSED(mess); AtomicIncrement(StartCount); job->Cancel(MESSAGE_UNKNOWN); - return nullptr; + return nullptr; } }; @@ -78,7 +78,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { struct TSleepModule: public TExampleServerModule { TSystemEvent MessageReceivedEvent; - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); MessageReceivedEvent.Signal(); @@ -113,14 +113,14 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { struct TSendReplyModule: public TExampleServerModule { TSystemEvent MessageReceivedEvent; - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); job->SendReply(new TExampleResponse(&Proto.ResponseCount)); MessageReceivedEvent.Signal(); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/use_count_checker.cpp b/library/cpp/messagebus/use_count_checker.cpp index c6243ea21f..54f111bad8 100644 --- a/library/cpp/messagebus/use_count_checker.cpp +++ b/library/cpp/messagebus/use_count_checker.cpp @@ -20,7 +20,7 @@ void TUseCountChecker::Dec() { } TUseCountHolder::TUseCountHolder() - : CurrentChecker(nullptr) + : CurrentChecker(nullptr) { } diff --git a/library/cpp/messagebus/www/www.cpp b/library/cpp/messagebus/www/www.cpp index 62ec241d85..beb42b21d8 100644 --- a/library/cpp/messagebus/www/www.cpp +++ b/library/cpp/messagebus/www/www.cpp @@ -864,7 +864,7 @@ struct TBusWwwHttpServer::TImpl: public THttpServer::ICallBack { { } - bool Reply(void*) override { + bool Reply(void*) override { Outer->ServeRequest(Input(), Output()); return true; } @@ -912,11 +912,11 @@ struct TBusWwwHttpServer::TImpl: public THttpServer::ICallBack { } } - TClientRequest* CreateClient() override { + TClientRequest* CreateClient() override { return new TClientRequestImpl(this); } - ~TImpl() override { + ~TImpl() override { HttpServer.Stop(); } }; |