Rodin::Alert::Notation class

Specialized text class for mathematical and technical notation.

Provides a colored text formatting class specifically for displaying mathematical notation, variable names, and technical identifiers in alert messages. Notation objects are displayed in magenta to distinguish them from regular message text.

This class includes static factory methods for common notation patterns used throughout Rodin, such as polytope identifiers, incidence relations, and numeric values.

Example usage: Exception() << "Invalid polytope " << Notation::Polytope(2, 5) << Raise;

Base classes

template<class F = NoColorT, class B = NoColorT>
class Text<NotationForeground>
Templated text class with foreground and background color support.

Public types

using Parent = Text<NotationForeground>
Parent class type alias.

Public static variables

static const Notation Arrow
Static arrow notation instance.

Public static functions

static auto Text(const std::string& text) -> Notation
Factory method for text notation.
template<class T>
static auto Number(const T& out) -> Notation
Factory method for numeric notation.
template<class T>
static auto Print(const T& out) -> Notation
Factory method for general printable values.
static auto Incidence(size_t d, size_t dp) -> Notation
Factory method for incidence relation notation.
static auto Polytope(size_t d, Index index) -> Notation
Factory method for polytope notation.
static auto True() -> Notation
Factory method for boolean true notation.
static auto False() -> Notation
Factory method for boolean false notation.
static auto Predicate(bool v, const std::string& pred) -> Notation
Factory method for predicate notation.
template<class Iterator>
static auto Set(Iterator first, Iterator last) -> Notation
Factory method for set notation.

Constructors, destructors, conversion operators

Notation(const std::string& text)
Constructs notation from a string.
Notation(const char* out)
Constructs notation from a C-style string.
template<class T>
Notation(const T& out)
Constructs notation from any type convertible to string.
Notation(const Notation& other)
Copy constructor.
Notation(Notation&& other)
Move constructor.

Function documentation

static Notation Rodin::Alert::Notation::Text(const std::string& text)

Factory method for text notation.

Parameters
text The text content.
Returns Notation object containing the text.

template<class T>
static Notation Rodin::Alert::Notation::Number(const T& out)

Factory method for numeric notation.

Template parameters
T Arithmetic type.
Parameters
out The numeric value.
Returns Notation object containing the formatted number.

template<class T>
static Notation Rodin::Alert::Notation::Print(const T& out)

Factory method for general printable values.

Template parameters
T Type supporting stream insertion.
Parameters
out The value to print.
Returns Notation object containing the formatted value.

static Notation Rodin::Alert::Notation::Incidence(size_t d, size_t dp)

Factory method for incidence relation notation.

Parameters
d First dimension.
dp Second dimension.
Returns Notation object representing the incidence relation.

Creates notation for mesh incidence relations in the form "Incidence(d → dp)" where the arrow represents topological adjacency.

static Notation Rodin::Alert::Notation::Polytope(size_t d, Index index)

Factory method for polytope notation.

Parameters
d Dimension of the polytope.
index Index of the polytope.
Returns Notation object representing the polytope.

Creates notation for polytope identifiers in the form "Polytope(d, index)".

static Notation Rodin::Alert::Notation::True()

Factory method for boolean true notation.

Returns Notation object containing "true".

static Notation Rodin::Alert::Notation::False()

Factory method for boolean false notation.

Returns Notation object containing "false".

static Notation Rodin::Alert::Notation::Predicate(bool v, const std::string& pred)

Factory method for predicate notation.

Parameters
v Boolean value of the predicate.
pred Name of the predicate.
Returns Notation object representing the predicate evaluation.

Creates notation showing a predicate and its boolean value in the form "[pred] = true" or "[pred] = false".

template<class Iterator>
static Notation Rodin::Alert::Notation::Set(Iterator first, Iterator last)

Factory method for set notation.

Template parameters
Iterator Iterator type for the set elements.
Parameters
first Iterator to the first element.
last Iterator past the last element.
Returns Notation object representing the set.

Creates notation for sets in the form "{ elem1, elem2, ... }".

Rodin::Alert::Notation::Notation(const std::string& text)

Constructs notation from a string.

Parameters
text The notation text.

Rodin::Alert::Notation::Notation(const char* out)

Constructs notation from a C-style string.

Parameters
out The notation text as a null-terminated string.

template<class T>
Rodin::Alert::Notation::Notation(const T& out)

Constructs notation from any type convertible to string.

Template parameters
T The type to convert (must support std::to_string).
Parameters
out The value to convert to notation text.

Variable documentation

static const Notation Rodin::Alert::Notation::Arrow

Static arrow notation instance.

Constant notation object representing an arrow symbol, commonly used in incidence relations and mathematical expressions.