aboutsummaryrefslogtreecommitdiff
path: root/src/common/Logging/LogOperation.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-07-10 14:51:29 +0200
committerShauren <shauren.trinity@gmail.com>2024-07-10 14:51:29 +0200
commit1cd7898c01b6cfcdcd0314a3d79bf8a86aa1e619 (patch)
treefbd8cb01b0203de70dee9136c45abbcf94360ccd /src/common/Logging/LogOperation.h
parente05d194da3d742130cd2f9eb91051610d58f8236 (diff)
Core/Logging: Removed one layer of allocations from log message writes (async doesn't wrap in shared_ptr anymore and sync creates LogMessage on the stack)
Diffstat (limited to 'src/common/Logging/LogOperation.h')
-rw-r--r--src/common/Logging/LogOperation.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/common/Logging/LogOperation.h b/src/common/Logging/LogOperation.h
index 25dc075bd2f..0a642d56e12 100644
--- a/src/common/Logging/LogOperation.h
+++ b/src/common/Logging/LogOperation.h
@@ -24,14 +24,17 @@
class Logger;
struct LogMessage;
-class TC_COMMON_API LogOperation
+class LogOperation
{
public:
- LogOperation(Logger const* _logger, std::unique_ptr<LogMessage>&& _msg);
-
+ LogOperation(Logger const* _logger, LogMessage* _msg);
+ LogOperation(LogOperation const&) = delete;
+ LogOperation(LogOperation&&) noexcept = default;
+ LogOperation& operator=(LogOperation const&) = delete;
+ LogOperation& operator=(LogOperation&&) noexcept = default;
~LogOperation();
- int call();
+ void operator()() const;
protected:
Logger const* logger;