Simple-Log  alpha-v0.7
sl::log::ISink< TRecord > Class Template Referenceabstract

Sink interface class. More...

#include <ISink.hpp>

Inheritance diagram for sl::log::ISink< TRecord >:
sl::log::BasicSink< TRecord > sl::log::OStreamSink< TRecord > sl::log::ConsoleSink< TRecord > sl::log::FileSink< TRecord >

Public Types

using Record_t = std::remove_cvref_t< TRecord >
 Used Record type. More...
 

Public Member Functions

 ISink (const ISink &)=delete
 Deleted copy-constructor. More...
 
ISinkoperator= (const ISink &)=delete
 Deleted copy-assign operator. More...
 
virtual ~ISink () noexcept=default
 virtual default destructor More...
 
virtual void log (const Record_t &record)=0
 virtual log function More...
 
virtual void setEnabled (bool enable=true) noexcept=0
 Enables or disables the Sink object. More...
 
virtual bool isEnabled () const noexcept=0
 Checks if the Sink object is enabled. More...
 

Protected Member Functions

 ISink ()=default
 Default constructor. More...
 
 ISink (ISink &&)=default
 Default move-constructor. More...
 
ISinkoperator= (ISink &&)=default
 Default move-assign operator. More...
 

Detailed Description

template<Record TRecord>
class sl::log::ISink< TRecord >

Sink interface class.

Template Parameters
TRecordUsed Record type.

The interface class for each derived Sink type. If you want to implement your custom Sink type, have a look at BasicSink first. This might be a better starting point for customizations.

Member Typedef Documentation

◆ Record_t

template<Record TRecord>
using sl::log::ISink< TRecord >::Record_t = std::remove_cvref_t<TRecord>

Used Record type.

Constructor & Destructor Documentation

◆ ISink() [1/3]

template<Record TRecord>
sl::log::ISink< TRecord >::ISink ( const ISink< TRecord > &  )
delete

Deleted copy-constructor.

◆ ~ISink()

template<Record TRecord>
virtual sl::log::ISink< TRecord >::~ISink ( )
virtualdefaultnoexcept

virtual default destructor

◆ ISink() [2/3]

template<Record TRecord>
sl::log::ISink< TRecord >::ISink ( )
protecteddefault

Default constructor.

◆ ISink() [3/3]

template<Record TRecord>
sl::log::ISink< TRecord >::ISink ( ISink< TRecord > &&  )
protecteddefault

Default move-constructor.

Member Function Documentation

◆ isEnabled()

template<Record TRecord>
virtual bool sl::log::ISink< TRecord >::isEnabled ( ) const
pure virtualnoexcept

Checks if the Sink object is enabled.

Returns
Returns true if object is enabled.

Implemented in sl::log::BasicSink< TRecord >.

◆ log()

template<Record TRecord>
virtual void sl::log::ISink< TRecord >::log ( const Record_t record)
pure virtual

virtual log function

Will be called from the Worker thread.

Parameters
recordThe record about to be processed by the sink

Implemented in sl::log::BasicSink< TRecord >.

◆ operator=() [1/2]

template<Record TRecord>
ISink& sl::log::ISink< TRecord >::operator= ( const ISink< TRecord > &  )
delete

Deleted copy-assign operator.

◆ operator=() [2/2]

template<Record TRecord>
ISink& sl::log::ISink< TRecord >::operator= ( ISink< TRecord > &&  )
protecteddefault

Default move-assign operator.

◆ setEnabled()

template<Record TRecord>
virtual void sl::log::ISink< TRecord >::setEnabled ( bool  enable = true)
pure virtualnoexcept

Enables or disables the Sink object.

Disabled Sinks will not handle any incoming Record s

Parameters
enableTrue will enable the Sink object.

Implemented in sl::log::BasicSink< TRecord >.


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