bux API Reference 1.9.0
Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.
Loading...
Searching...
No Matches
SyncLog.cpp
Go to the documentation of this file.
1#include "SyncLog.h"
2#include <ostream> // std::ostream
3
4namespace bux {
5
6//
7// Implement Classes
8//
9std::ostream *C_SyncLogger::lockLog()
14{
15 m_lock.lock();
16 if (const auto ret = m_impl.useLog()) [[likely]]
17 return ret;
18
19 m_lock.unlock();
20 return nullptr;
21}
22
29{
30 m_lock.lock();
31 if (const auto ret = m_impl.useLog(ll)) [[likely]]
32 return ret;
33
34 m_lock.unlock();
35 return nullptr;
36}
37
43{
44 m_impl.unuseLog(flush);
45 m_lock.unlock();
46}
47
48} // namespace bux
std::ostream * lockLog() override
Definition SyncLog.cpp:9
void unlockLog(bool flush) override
Definition SyncLog.cpp:38
THE common namespace of bux library.
Definition AtomiX.cpp:3
E_LogLevel
Definition LogLevel.h:9
virtual void unuseLog(bool flush)=0
If the previous call to lockLog() returned null, the behavior is undefined.
virtual std::ostream * useLog()=0
Return non-null pointer if possible.