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
- 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
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:: 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:: 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, ... }".