Rodin::Alert module

Contextual exceptions and diagnostic reporting.

Alert::Info() << "Assembling the system..." << Alert::Raise;

Exception and MemberFunctionException report errors with contextual diagnostics. Info and Warning provide nonfatal messages through the same stream interface. These classes communicate invalid inputs, unavailable operations, and solver or mesh-processing status.

Alert Types

TypeColorBehavior
Alert::InfoBlueInformational message (non-fatal)
Alert::WarningYellowWarning message (non-fatal)
Alert::SuccessGreenSuccess notification (non-fatal)
Alert::ExceptionRedThrows an exception (fatal)
Alert::MemberFunctionExceptionRedException with class/method context
Alert::MemberFunctionWarningYellowWarning with class/method context

Usage Pattern

All alerts use the stream insertion operator << and terminate with Alert::Raise:

// Informational message
Alert::Info() << "Assembling the system..." << Alert::Raise;

// Warning
Alert::Warning() << "Convergence is slow." << Alert::Raise;

// Fatal exception (replaces throw)
Alert::MemberFunctionException(*this, __func__)
  << "Incidence " << d << " -> " << dp << " has not been computed."
  << Alert::Raise;

Namespaces

namespace Identifier
Namespace containing factory functions for code identifiers.

Classes

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

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 Rodin::Alert::Color16

Defined in Rodin/Alert/Color.h

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 Rodin::Alert::Attribute

Defined in Rodin/Alert/Text.h

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

Defined in Rodin/Alert/Notation.h

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)

Defined in Rodin/Alert/Color.h

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.

Color

Defined in Rodin/Alert/Color.h

See declaration
template<class Code>
Color(const Code& code) -> Color< Code >

Deduction guide for Color.

Template parameters
Code The color code type.
Parameters
code The RGB color code (defaults to default-constructed Code).

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

Defined in Rodin/Alert/Color.h

Stream insertion operator for custom RGB colors.

Template parameters
Code The RGB color code type.
Parameters
os Output stream to write to.
tag Formatting or action tag selected through its type.
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 RedT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for red color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const GreenT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for green color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const BlueT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for blue color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const YellowT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for yellow color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const MagentaT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for magenta color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const CyanT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for cyan color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const WhiteT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for white color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const GrayT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for gray color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const BrightGrayT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for bright gray color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

std::ostream& operator<<(std::ostream& os, const BrightWhiteT& tag)

Defined in Rodin/Alert/Color.h

Stream insertion operator for bright white color.

Parameters
os Output stream.
tag Formatting or action tag selected through its type.
Returns Output stream after writing the object.

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

Defined in Rodin/Alert/NewLine.h

Stream insertion operator for NewLineT.

Parameters
os The output stream to write to.
tag Formatting or action tag selected through its type.
Returns Reference to the output stream.

Inserts a newline character into the output stream.

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

Defined in Rodin/Alert/Reset.h

Stream insertion operator for ResetT.

Parameters
os The output stream to write to.
tag Formatting or action tag selected through its type.
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& tag)

Defined in Rodin/Alert/Stylize.h

Stream insertion operator for StylizeT.

Parameters
os The output stream to write to.
tag Formatting or action tag selected through its type.
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)

Defined in Rodin/Alert/Text.h

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.

Text

Defined in Rodin/Alert/Text.h

See declaration
Text(const std::string& text) -> Text< NoColorT, NoColorT >

Deduction guide for uncolored text.

Parameters
text The text content.

Text

Defined in Rodin/Alert/Text.h

See declaration
template<class F>
Text(const std::string& text, const F& fg) -> Text< F, NoColorT >

Deduction guide for text with a foreground color.

Template parameters
F Foreground color type.
Parameters
text The text content.
fg The foreground color.

Text

Defined in Rodin/Alert/Text.h

See declaration
template<class F, class B>
Text(const std::string& text, const F& fg, const B& bg) -> Text< F, B >

Deduction guide for text with foreground and background colors.

Template parameters
F Foreground color type.
B Background color type.
Parameters
text The text content.
fg The foreground color.
bg The background color.

template<class Foreground, class Background>
std::ostream& operator<<(std::ostream& os, const Text<Foreground, Background>& text)

Defined in Rodin/Alert/Text.h

Writes text with foreground and background formatting.

Template parameters
Foreground Foreground color type.
Background Background color type.
Parameters
os The output stream.
text The text to write.
Returns Reference to the output stream.

template<class Foreground>
std::ostream& operator<<(std::ostream& os, const Text<Foreground, NoColorT>& text)

Defined in Rodin/Alert/Text.h

Writes text with foreground formatting.

Template parameters
Foreground Foreground color type.
Parameters
os The output stream.
text The text to write.
Returns Reference to the output stream.

template<class Background>
std::ostream& operator<<(std::ostream& os, const Text<NoColorT, Background>& text)

Defined in Rodin/Alert/Text.h

Writes text with background formatting.

Template parameters
Background Background color type.
Parameters
os The output stream.
text The text to write.
Returns Reference to the output stream.

std::ostream& operator<<(std::ostream& os, const Text<NoColorT, NoColorT>& text)

Defined in Rodin/Alert/Text.h

Writes text without color formatting.

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

Variable documentation

static BoldT Rodin::Alert::Bold constexpr

Defined in Rodin/Alert/Bold.h

Instance of BoldT tag type.

Constant instance of the BoldT tag type for convenient usage.

static NoColorT Rodin::Alert::NoColor constexpr

Defined in Rodin/Alert/Color.h

Instance of NoColorT tag type.

Constant instance of the NoColorT tag type for convenient usage.

static RedT Rodin::Alert::Red constexpr

Defined in Rodin/Alert/Color.h

Instance of RedT tag type.

static GreenT Rodin::Alert::Green constexpr

Defined in Rodin/Alert/Color.h

Instance of GreenT tag type.

static BlueT Rodin::Alert::Blue constexpr

Defined in Rodin/Alert/Color.h

Instance of BlueT tag type.

static YellowT Rodin::Alert::Yellow constexpr

Defined in Rodin/Alert/Color.h

Instance of YellowT tag type.

static MagentaT Rodin::Alert::Magenta constexpr

Defined in Rodin/Alert/Color.h

Instance of MagentaT tag type.

static CyanT Rodin::Alert::Cyan constexpr

Defined in Rodin/Alert/Color.h

Instance of CyanT tag type.

static WhiteT Rodin::Alert::White constexpr

Defined in Rodin/Alert/Color.h

Instance of WhiteT tag type.

static GrayT Rodin::Alert::Gray constexpr

Defined in Rodin/Alert/Color.h

Instance of GrayT tag type.

static BrightGrayT Rodin::Alert::BrightGray constexpr

Defined in Rodin/Alert/Color.h

Instance of BrightGrayT tag type.

static BrightWhiteT Rodin::Alert::BrightWhite constexpr

Defined in Rodin/Alert/Color.h

Instance of BrightWhiteT tag type.

static NewLineT Rodin::Alert::NewLine constexpr

Defined in Rodin/Alert/NewLine.h

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 Rodin::Alert::Raise constexpr

Defined in Rodin/Alert/Raise.h

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 Rodin::Alert::Reset constexpr

Defined in Rodin/Alert/Reset.h

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 Rodin::Alert::Stylize constexpr

Defined in Rodin/Alert/Stylize.h

Instance of StylizeT tag type.

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