LLDB mainline
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lldb_private::RotatingLogHandler Class Reference

#include <Log.h>

Inheritance diagram for lldb_private::RotatingLogHandler:
Inheritance graph
[legend]

Public Member Functions

 RotatingLogHandler (size_t size)
 
void Emit (llvm::StringRef message) override
 
void Dump (llvm::raw_ostream &stream) const
 
bool isA (const void *ClassID) const override
 
- Public Member Functions inherited from lldb_private::LogHandler
virtual ~LogHandler ()=default
 
virtual void Emit (llvm::StringRef message)=0
 
virtual bool isA (const void *ClassID) const
 

Static Public Member Functions

static bool classof (const LogHandler *obj)
 
- Static Public Member Functions inherited from lldb_private::LogHandler
static bool classof (const LogHandler *obj)
 

Private Member Functions

size_t NormalizeIndex (size_t i) const
 
size_t GetNumMessages () const
 
size_t GetFirstMessageIndex () const
 

Private Attributes

std::mutex m_mutex
 
std::unique_ptr< std::string[]> m_messages
 
const size_t m_size = 0
 
size_t m_next_index = 0
 
size_t m_total_count = 0
 

Static Private Attributes

static char ID
 

Detailed Description

Definition at line 92 of file Log.h.

Constructor & Destructor Documentation

◆ RotatingLogHandler()

RotatingLogHandler::RotatingLogHandler ( size_t  size)

Definition at line 423 of file Log.cpp.

Member Function Documentation

◆ classof()

static bool lldb_private::RotatingLogHandler::classof ( const LogHandler obj)
inlinestatic

Definition at line 100 of file Log.h.

References ID, and lldb_private::LogHandler::isA().

◆ Dump()

void RotatingLogHandler::Dump ( llvm::raw_ostream &  stream) const

◆ Emit()

void RotatingLogHandler::Emit ( llvm::StringRef  message)
overridevirtual

Implements lldb_private::LogHandler.

Definition at line 426 of file Log.cpp.

References m_messages, m_mutex, m_next_index, m_total_count, and NormalizeIndex().

Referenced by lldb_private::Diagnostics::Report().

◆ GetFirstMessageIndex()

size_t RotatingLogHandler::GetFirstMessageIndex ( ) const
private

Definition at line 440 of file Log.cpp.

References m_next_index, m_size, and m_total_count.

Referenced by Dump().

◆ GetNumMessages()

size_t RotatingLogHandler::GetNumMessages ( ) const
private

Definition at line 436 of file Log.cpp.

References m_size, and m_total_count.

Referenced by Dump().

◆ isA()

bool lldb_private::RotatingLogHandler::isA ( const void *  ClassID) const
inlineoverridevirtual

Reimplemented from lldb_private::LogHandler.

Definition at line 99 of file Log.h.

References ID.

◆ NormalizeIndex()

size_t RotatingLogHandler::NormalizeIndex ( size_t  i) const
private

Definition at line 434 of file Log.cpp.

References m_size.

Referenced by Dump(), and Emit().

Member Data Documentation

◆ ID

char RotatingLogHandler::ID
staticprivate

Definition at line 112 of file Log.h.

Referenced by classof(), and isA().

◆ m_messages

std::unique_ptr<std::string[]> lldb_private::RotatingLogHandler::m_messages
private

Definition at line 108 of file Log.h.

Referenced by Dump(), and Emit().

◆ m_mutex

std::mutex lldb_private::RotatingLogHandler::m_mutex
mutableprivate

Definition at line 107 of file Log.h.

Referenced by Dump(), and Emit().

◆ m_next_index

size_t lldb_private::RotatingLogHandler::m_next_index = 0
private

Definition at line 110 of file Log.h.

Referenced by Emit(), and GetFirstMessageIndex().

◆ m_size

const size_t lldb_private::RotatingLogHandler::m_size = 0
private

Definition at line 109 of file Log.h.

Referenced by GetFirstMessageIndex(), GetNumMessages(), and NormalizeIndex().

◆ m_total_count

size_t lldb_private::RotatingLogHandler::m_total_count = 0
private

Definition at line 111 of file Log.h.

Referenced by Emit(), GetFirstMessageIndex(), and GetNumMessages().


The documentation for this class was generated from the following files: