Alert module

Alert and exception handling system for Rodin.

The Alert module provides a comprehensive system for handling exceptions, warnings, informational messages, and success notifications with colored terminal output and formatted messaging capabilities.

Files

file ForwardDecls.h
Forward declarations for Alert module types.

Namespaces

namespace Rodin::Alert::Identifier
Namespace containing factory functions for code identifiers.

Classes

struct Rodin::Alert::BoldT
Empty tag type for bold text formatting.
template<class T>
class Rodin::Alert::ClassException
Exception class that automatically includes the class name.
template<size_t RED, size_t GREEN, size_t BLUE>
struct Rodin::Alert::RGB
RGB color template with compile-time color values.
struct Rodin::Alert::NoColorT
Tag type representing no color (transparent/default).
template<class CodeT>
class Rodin::Alert::Color
Type-safe wrapper for custom RGB colors.
struct Rodin::Alert::RedT
Tag type for red terminal color.
struct Rodin::Alert::GreenT
Tag type for green terminal color.
struct Rodin::Alert::BlueT
Tag type for blue terminal color.
struct Rodin::Alert::YellowT
Tag type for yellow terminal color.
struct Rodin::Alert::MagentaT
Tag type for magenta terminal color.
struct Rodin::Alert::CyanT
Tag type for cyan terminal color.
struct Rodin::Alert::WhiteT
Tag type for white terminal color.
struct Rodin::Alert::GrayT
Tag type for gray terminal color.
struct Rodin::Alert::BrightGrayT
Tag type for bright gray terminal color.
struct Rodin::Alert::BrightWhiteT
Tag type for bright white terminal color.
class Rodin::Alert::ExceptionPrefix
Prefix class for exception messages.
class Rodin::Alert::Exception
Exception class with formatted output capabilities.
template<class Foreground>
class Rodin::Alert::IdentifierT
Templated text class for code identifiers with bold formatting.
class Rodin::Alert::InfoPrefix
Prefix class for informational messages.
class Rodin::Alert::Info
Informational message class with formatted output.
template<class T, class FuncName>
class Rodin::Alert::MemberFunctionWarning
Warning type for issues occurring in member functions.
template<class Foreground>
class Rodin::Alert::MessagePrefix
Base class for message prefixes with colored text.
template<class Prefix>
class Rodin::Alert::Message
Forward declaration of the Message template class.
class Rodin::Alert::NamespacedException
Exception class that automatically includes the namespace name.
struct Rodin::Alert::NewLineT
Empty tag type for inserting newline characters.
class Rodin::Alert::Notation
Specialized text class for mathematical and technical notation.
struct Rodin::Alert::RaiseT
Empty tag type for raising an Alert message.
struct Rodin::Alert::ResetT
Empty tag type for resetting terminal formatting.
struct Rodin::Alert::StylizeT
Empty tag type for enabling terminal color output.
class Rodin::Alert::SuccessPrefix
Prefix class for success messages.
class Rodin::Alert::Success
Success message class with formatted output.
template<class F = NoColorT, class B = NoColorT>
class Rodin::Alert::Text
Templated text class with foreground and background color support.
class Rodin::Alert::WarningPrefix
Prefix class for warning messages.
class Rodin::Alert::Warning
Warning message class with formatted output.

Enums

enum class Color16 { Red, Green, Blue, Yellow, Magenta, Cyan, Gray, White, BrightGray, BrightWhite }
Enumeration of basic 16-color terminal colors.
enum class Attribute { Bold, Dark, Italic, Underline, Blink, Reverse, Concealed, Crossed }
Text formatting attributes for terminal output.

Typedefs

using NotationForeground = MagentaT
Type alias for notation foreground color.

Functions

auto operator<<(std::ostream& os, Color16 c) -> std::ostream&
Stream insertion operator for Color16.
template<class Code>
auto operator<<(std::ostream& os, const Color<Code>&) -> std::ostream&
Stream insertion operator for custom RGB colors.
auto operator<<(std::ostream& os, const RedT&) -> std::ostream&
Stream insertion operator for red color.
auto operator<<(std::ostream& os, const GreenT&) -> std::ostream&
Stream insertion operator for green color.
auto operator<<(std::ostream& os, const BlueT&) -> std::ostream&
Stream insertion operator for blue color.
auto operator<<(std::ostream& os, const YellowT&) -> std::ostream&
Stream insertion operator for yellow color.
auto operator<<(std::ostream& os, const MagentaT&) -> std::ostream&
Stream insertion operator for magenta color.
auto operator<<(std::ostream& os, const CyanT&) -> std::ostream&
Stream insertion operator for cyan color.
auto operator<<(std::ostream& os, const WhiteT&) -> std::ostream&
Stream insertion operator for white color.
auto operator<<(std::ostream& os, const GrayT&) -> std::ostream&
Stream insertion operator for gray color.
auto operator<<(std::ostream& os, const BrightGrayT&) -> std::ostream&
Stream insertion operator for bright gray color.
auto operator<<(std::ostream& os, const BrightWhiteT&) -> std::ostream&
Stream insertion operator for bright white color.
auto operator<<(std::ostream& os, const NewLineT&) -> std::ostream&
Stream insertion operator for NewLineT.
auto operator<<(std::ostream& os, const ResetT&) -> std::ostream&
Stream insertion operator for ResetT.
auto operator<<(std::ostream& os, const StylizeT&) -> std::ostream&
Stream insertion operator for StylizeT.
auto operator<<(std::ostream& os, Attribute a) -> std::ostream&
Stream insertion operator for text attributes.

Variables

static BoldT Bold constexpr
Instance of BoldT tag type.
static NoColorT NoColor constexpr
Instance of NoColorT tag type.
static RedT Red constexpr
Instance of RedT tag type.
static GreenT Green constexpr
Instance of GreenT tag type.
static BlueT Blue constexpr
Instance of BlueT tag type.
static YellowT Yellow constexpr
Instance of YellowT tag type.
static MagentaT Magenta constexpr
Instance of MagentaT tag type.
static CyanT Cyan constexpr
Instance of CyanT tag type.
static WhiteT White constexpr
Instance of WhiteT tag type.
static GrayT Gray constexpr
Instance of GrayT tag type.
static BrightGrayT BrightGray constexpr
Instance of BrightGrayT tag type.
static BrightWhiteT BrightWhite constexpr
Instance of BrightWhiteT tag type.
static NewLineT NewLine constexpr
Instance of NewLineT tag type.
static RaiseT Raise constexpr
Instance of RaiseT tag type.
static ResetT Reset constexpr
Instance of ResetT tag type.
static StylizeT Stylize constexpr
Instance of StylizeT tag type.

Enum documentation

enum class Color16

Enumeration of basic 16-color terminal colors.

Provides an enumeration of the standard 16-color terminal palette including primary colors, gray shades, and bright variants. These colors are widely supported across terminal emulators.

Enumerators
Red

Standard red color.

Green

Standard green color.

Blue

Standard blue color.

Yellow

Standard yellow color.

Magenta

Standard magenta color.

Cyan

Standard cyan color.

Gray

Standard gray color.

White

Standard white color.

BrightGray

Bright gray color.

BrightWhite

Bright white color.

enum class Attribute

Text formatting attributes for terminal output.

Enumeration of text formatting attributes that can be applied to terminal output including bold, italic, underline, and other visual effects.

Enumerators
Bold

Bold text formatting.

Dark

Dark text formatting.

Italic

Italic text formatting

Underline

Underlined text.

Blink

Blinking text effect.

Reverse

Reverse video (inverted colors)

Concealed

Concealed/hidden text.

Crossed

Crossed-out text.

Typedef documentation

using NotationForeground = MagentaT

Type alias for notation foreground color.

Notation text uses magenta color for visual distinction in messages.

Function documentation

std::ostream& operator<<(std::ostream& os, Color16 c)

Stream insertion operator for Color16.

Parameters
os Output stream to write to.
c The color to apply.
Returns Reference to the output stream.

Applies the specified 16-color terminal color to the output stream using the termcolor library.

template<class Code>
std::ostream& operator<<(std::ostream& os, const Color<Code>&)

Stream insertion operator for custom RGB colors.

Template parameters
Code The RGB color code type.
Parameters
os Output stream to write to.
Returns Reference to the output stream.

Applies a custom RGB color to the output stream using the termcolor library's color template.

std::ostream& operator<<(std::ostream& os, const NewLineT&)

Stream insertion operator for NewLineT.

Parameters
os The output stream to write to.
Returns Reference to the output stream.

Inserts a newline character into the output stream.

std::ostream& operator<<(std::ostream& os, const ResetT&)

Stream insertion operator for ResetT.

Parameters
os The output stream to write to.
Returns Reference to the output stream.

Resets all terminal formatting and colors to default using the termcolor library.

std::ostream& operator<<(std::ostream& os, const StylizeT&)

Stream insertion operator for StylizeT.

Parameters
os The output stream to write to.
Returns Reference to the output stream.

Enables terminal colorization for the output stream using the termcolor library.

std::ostream& operator<<(std::ostream& os, Attribute a)

Stream insertion operator for text attributes.

Parameters
os Output stream to write to.
a The attribute to apply.
Returns Reference to the output stream.

Applies the specified text formatting attribute to the output stream using termcolor library functionality.

Variable documentation

static BoldT Bold constexpr

Instance of BoldT tag type.

Constant instance of the BoldT tag type for convenient usage.

static NoColorT NoColor constexpr

Instance of NoColorT tag type.

Constant instance of the NoColorT tag type for convenient usage.

static NewLineT NewLine constexpr

Instance of NewLineT tag type.

Constant instance of the NewLineT tag type for convenient usage. Use this to insert newlines in Alert messages with proper indentation.

static RaiseT Raise constexpr

Instance of RaiseT tag type.

Constant instance of the RaiseT tag type for convenient usage. Stream this into a Message to trigger its raise() method.

static ResetT Reset constexpr

Instance of ResetT tag type.

Constant instance of the ResetT tag type for convenient usage. Use this to reset terminal formatting to default.

static StylizeT Stylize constexpr

Instance of StylizeT tag type.

Constant instance of the StylizeT tag type for convenient usage. Use this to enable colored terminal output.