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]
Collaboration diagram for lldb_private::RotatingLogHandler:
Collaboration 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
 

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 395 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

Definition at line 416 of file Log.cpp.

References GetFirstMessageIndex(), GetNumMessages(), m_messages, m_mutex, and NormalizeIndex().

◆ Emit()

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

Implements lldb_private::LogHandler.

Definition at line 398 of file Log.cpp.

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

◆ GetFirstMessageIndex()

size_t RotatingLogHandler::GetFirstMessageIndex ( ) const
private

Definition at line 412 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 408 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 406 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: