Ginkgo  Generated from pipelines/238965899 branch based on develop. Ginkgo version 1.3.0
A numerical linear algebra library targeting many-core architectures
Public Member Functions | List of all members
gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase > Class Template Reference

EnableLogging is a mixin which should be inherited by any class which wants to enable logging. More...

#include <ginkgo/core/log/logger.hpp>

Collaboration diagram for gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >:
[legend]

Public Member Functions

void add_logger (std::shared_ptr< const Logger > logger) override
 Adds a new logger to the list of subscribed loggers. More...
 
void remove_logger (const Logger *logger) override
 Removes a logger from the list of subscribed loggers. More...
 

Detailed Description

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>
class gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >

EnableLogging is a mixin which should be inherited by any class which wants to enable logging.

All the received events are passed to the loggers this class contains.

Template Parameters
ConcreteLoggablethe object being logged [CRTP parameter]
PolymorphicBasethe polymorphic base of this class. By default it is Loggable. Change it if you want to use a new superclass of Loggable as polymorphic base of this class.

Member Function Documentation

◆ add_logger()

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>
void gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >::add_logger ( std::shared_ptr< const Logger logger)
inlineoverridevirtual

Adds a new logger to the list of subscribed loggers.

Parameters
loggerthe logger to add

Implements gko::log::Loggable.

◆ remove_logger()

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>
void gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >::remove_logger ( const Logger logger)
inlineoverridevirtual

Removes a logger from the list of subscribed loggers.

Parameters
loggerthe logger to remove
Note
The comparison is done using the logger's object unique identity. Thus, two loggers constructed in the same way are not considered equal.

Implements gko::log::Loggable.


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