From 3e0b762a82514bac89c1dd6ea7211e381d8aa248 Mon Sep 17 00:00:00 2001 From: Sergey Polovko <sergey@polovko.me> Date: Thu, 10 Feb 2022 16:47:02 +0300 Subject: Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 1 of 2. --- library/cpp/grpc/server/event_callback.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'library/cpp/grpc/server/event_callback.h') diff --git a/library/cpp/grpc/server/event_callback.h b/library/cpp/grpc/server/event_callback.h index d0b700b3c9..13d9bb46b2 100644 --- a/library/cpp/grpc/server/event_callback.h +++ b/library/cpp/grpc/server/event_callback.h @@ -2,7 +2,7 @@ #include "grpc_server.h" -namespace NGrpc { +namespace NGrpc { enum class EQueueEventStatus { OK, @@ -10,7 +10,7 @@ enum class EQueueEventStatus { }; template<class TCallback> -class TQueueEventCallback: public IQueueEvent { +class TQueueEventCallback: public IQueueEvent { public: TQueueEventCallback(const TCallback& callback) : Callback(callback) @@ -33,9 +33,9 @@ private: TCallback Callback; }; -// Implementation of IQueueEvent that reduces allocations +// Implementation of IQueueEvent that reduces allocations template<class TSelf> -class TQueueFixedEvent: private IQueueEvent { +class TQueueFixedEvent: private IQueueEvent { using TCallback = void (TSelf::*)(EQueueEventStatus); public: @@ -44,7 +44,7 @@ public: , Callback(callback) { } - IQueueEvent* Prepare() { + IQueueEvent* Prepare() { Self->Ref(); return this; } @@ -65,16 +65,16 @@ private: }; template<class TCallback> -inline IQueueEvent* MakeQueueEventCallback(TCallback&& callback) { +inline IQueueEvent* MakeQueueEventCallback(TCallback&& callback) { return new TQueueEventCallback<TCallback>(std::forward<TCallback>(callback)); } template<class T> -inline IQueueEvent* MakeQueueEventCallback(T* self, void (T::*method)(EQueueEventStatus)) { +inline IQueueEvent* MakeQueueEventCallback(T* self, void (T::*method)(EQueueEventStatus)) { using TPtr = TIntrusivePtr<T>; return MakeQueueEventCallback([self = TPtr(self), method] (EQueueEventStatus status) { ((*self).*method)(status); }); } -} // namespace NGrpc +} // namespace NGrpc -- cgit v1.2.3