MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ scribe()

void MayaFlux::Journal::Archivist::Impl::scribe ( const JournalEntry &  entry)
inline

Definition at line 70 of file Archivist.cpp.

71 {
72 if (!m_accepting_entries.load(std::memory_order_acquire))
73 return;
74
75 if (!should_log(entry.severity, entry.component, entry.context))
76 return;
77
78 RealtimeEntry rt(entry.severity, entry.component, entry.context,
79 entry.message, entry.location);
80
81 while (m_push_lock.test_and_set(std::memory_order_acquire))
82 ;
83 const bool pushed = m_ring_buffer.push(rt);
84 m_push_lock.clear(std::memory_order_release);
85
86 if (!pushed)
87 m_dropped_messages.fetch_add(1, std::memory_order_relaxed);
88 }
bool should_log(Severity severity, Component component, Context context) const
std::atomic< bool > m_accepting_entries
Memory::LockFreeQueue< RealtimeEntry, RING_BUFFER_SIZE > m_ring_buffer
std::atomic< uint64_t > m_dropped_messages

References MayaFlux::Journal::JournalEntry::component, MayaFlux::Journal::JournalEntry::context, MayaFlux::Journal::JournalEntry::location, m_accepting_entries, m_dropped_messages, m_push_lock, m_ring_buffer, MayaFlux::Journal::JournalEntry::message, MayaFlux::Journal::JournalEntry::severity, and should_log().

+ Here is the call graph for this function: