CppLogging  1.0.4.0
C++ Logging Library
Public Member Functions | List of all members
CppLogging::MemoryAppender Class Reference

Memory appender. More...

#include <memory_appender.h>

Inheritance diagram for CppLogging::MemoryAppender:
CppLogging::Appender CppLogging::Element

Public Member Functions

 MemoryAppender (size_t capacity=0)
 Initialize the appender with a given capacity. More...
 
 MemoryAppender (const MemoryAppender &)=delete
 
 MemoryAppender (MemoryAppender &&)=delete
 
virtual ~MemoryAppender ()=default
 
MemoryAppenderoperator= (const MemoryAppender &)=delete
 
MemoryAppenderoperator= (MemoryAppender &&)=delete
 
std::vector< uint8_t > & buffer () noexcept
 Get memory buffer. More...
 
const std::vector< uint8_t > & buffer () const noexcept
 Get constant memory buffer. More...
 
void AppendRecord (Record &record) override
 Append the given logging record. More...
 
- Public Member Functions inherited from CppLogging::Appender
virtual void Flush ()
 Flush the logging appender. More...
 
- Public Member Functions inherited from CppLogging::Element
virtual bool IsStarted () const noexcept
 Is the logging element started? More...
 
virtual bool Start ()
 Start the logging element. More...
 
virtual bool Stop ()
 Stop the logging element. More...
 

Detailed Description

Memory appender.

Memory appender collects all given logging records into growing memory buffer with the given initial capacity.

Not thread-safe.

Definition at line 23 of file memory_appender.h.

Constructor & Destructor Documentation

◆ MemoryAppender() [1/3]

CppLogging::MemoryAppender::MemoryAppender ( size_t  capacity = 0)
inlineexplicit

Initialize the appender with a given capacity.

Parameters
capacity- Memory buffer capacity (default is 0)

Definition at line 30 of file memory_appender.h.

◆ MemoryAppender() [2/3]

CppLogging::MemoryAppender::MemoryAppender ( const MemoryAppender )
delete

◆ MemoryAppender() [3/3]

CppLogging::MemoryAppender::MemoryAppender ( MemoryAppender &&  )
delete

◆ ~MemoryAppender()

virtual CppLogging::MemoryAppender::~MemoryAppender ( )
virtualdefault

Member Function Documentation

◆ AppendRecord()

void CppLogging::MemoryAppender::AppendRecord ( Record record)
overridevirtual

Append the given logging record.

Parameters
record- Logging record

Implements CppLogging::Appender.

Definition at line 13 of file memory_appender.cpp.

◆ buffer() [1/2]

const std::vector<uint8_t>& CppLogging::MemoryAppender::buffer ( ) const
inlinenoexcept

Get constant memory buffer.

Definition at line 41 of file memory_appender.h.

◆ buffer() [2/2]

std::vector<uint8_t>& CppLogging::MemoryAppender::buffer ( )
inlinenoexcept

Get memory buffer.

Definition at line 39 of file memory_appender.h.

◆ operator=() [1/2]

MemoryAppender& CppLogging::MemoryAppender::operator= ( const MemoryAppender )
delete

◆ operator=() [2/2]

MemoryAppender& CppLogging::MemoryAppender::operator= ( MemoryAppender &&  )
delete

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