Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
LogManager::FilterToken Class Reference

Represents the life span of a filter. When it is created, the filter is added to the associated LogManager. When it is deleted, the filter is removed from the LogManager. More...

#include <Workspace/Application/logmanager.h>

Public Member Functions

 FilterToken (const FilterToken &other)=delete
 
 ~FilterToken ()
 
FilterTokenoperator= (const FilterToken &rhs)=delete
 

Protected Member Functions

 FilterToken (LogManager &mgr, const QSet< MessageCategory > &categoriesToSuppress)
 

Detailed Description

Enables calling code to use RAII to activate/deactivate a log filter for a section of code, without worrying about resetting that filter.

Filter tokens cannot be copied, moved, or assigned and the only way they can be created is through the invocation of the LogManager::filterMessages() method.

Constructor & Destructor Documentation

◆ ~FilterToken()

◆ FilterToken() [1/2]

FilterToken ( const FilterToken other)
delete

◆ FilterToken() [2/2]

FilterToken ( LogManager mgr,
const QSet< MessageCategory > &  categoriesToSuppress 
)
protected
Parameters
mgrThe LogManager that created this filter token. Only LogManager objects are capable of creating a FilterToken.
categoriesToSuppressThe list of log categories that are to be suppressed by the filter.

Creates a LogStreamFilter and installs it in the LogManager. As long as this token object is alive, the filter remains installed.

Member Function Documentation

◆ operator=()

FilterToken & operator= ( const FilterToken rhs)
delete