// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "Trace/Config.h" #if TRACE_PRIVATE_MINIMAL_ENABLED #include "Writer.inl" namespace UE { namespace Trace { namespace Private { struct FWriteBuffer; template class TLogScope; //////////////////////////////////////////////////////////////////////////////// class FLogScope { friend class FEventNode; public: template static auto Enter(); template static auto ScopedEnter(); template static auto ScopedStampedEnter(); void* GetPointer() const { return Ptr; } const FLogScope& operator << (bool) const { return *this; } constexpr explicit operator bool () const { return true; } template struct FFieldSet; protected: void Commit() const; void Commit(FWriteBuffer* __restrict LatestBuffer) const; private: template static auto EnterImpl(uint32 Uid, uint32 Size); template inline void EnterPrelude(uint32 Size); inline void Enter(uint32 Uid, uint32 Size); inline void EnterNoSync(uint32 Uid, uint32 Size); uint8* Ptr; FWriteBuffer* Buffer; }; template class TLogScope : public FLogScope { public: inline void operator += (const FLogScope&) const; }; //////////////////////////////////////////////////////////////////////////////// class FScopedLogScope { public: ~FScopedLogScope(); void SetActive(); bool bActive = false; private: void Deinit(); }; //////////////////////////////////////////////////////////////////////////////// class FScopedStampedLogScope { public: ~FScopedStampedLogScope(); void SetActive(); bool bActive = false; private: void Deinit(); }; } // namespace Private } // namespace Trace } // namespace UE #endif // TRACE_PRIVATE_MINIMAL_ENABLED