RNA Folding simulation
Public Types | Public Member Functions | List of all members
LogType Class Reference

The LogType class is used to define different types of logs using bit flags. Each log type is represented by a different bit in a std::uint8_t value. This allows multiple log types to be combined using bitwise operations. More...

#include <herrlog.hh>

Public Types

enum  : std::uint8_t {
  Trace = 0b000001 , Debug = 0b000010 , Info = 0b000100 , Error = 0b001000 ,
  Warn = 0b010000 , Fatal = 0b100000 , All = 0b111111 , None = 0b000000
}
 Enum defining different log types as bit flags.
 

Public Member Functions

 LogType (std::uint8_t initial_flag)
 Construct a new Log Type object. Allows implicit conversion from uint8_t. Thus allows assignments like LogType Logger::log_type = LogType::All;. More...
 
LogType operator| (const LogType other) const
 Overloading the | operator for combining log types. More...
 
bool operator& (const LogType other) const
 Overloading the & operator for checking if a log type is set. More...
 

Detailed Description

The LogType class is used to define different types of logs using bit flags. Each log type is represented by a different bit in a std::uint8_t value. This allows multiple log types to be combined using bitwise operations.

Definition at line 65 of file herrlog.hh.

Constructor & Destructor Documentation

◆ LogType()

LogType::LogType ( std::uint8_t  initial_flag)
inline

Construct a new Log Type object. Allows implicit conversion from uint8_t. Thus allows assignments like LogType Logger::log_type = LogType::All;.

Parameters
initial_flag

Definition at line 93 of file herrlog.hh.

Member Function Documentation

◆ operator&()

bool LogType::operator& ( const LogType  other) const
inline

Overloading the & operator for checking if a log type is set.

Parameters
other
Returns
true if the bit is set in both operands
false otherwise

Definition at line 112 of file herrlog.hh.

◆ operator|()

LogType LogType::operator| ( const LogType  other) const
inline

Overloading the | operator for combining log types.

Parameters
other
Returns
LogType

Definition at line 100 of file herrlog.hh.


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