Zth (libzth)
zth::fsm::Symbol Class Reference

A input/state symbol. More...

#include <fsm14.h>

Public Member Functions

constexpr Symbol (char const *s=nullptr) noexcept
 Ctor. More...
 
constexpr bool constexpr_eq (Symbol const &s) const noexcept
 Like == operator, but constexpr. More...
 
bool operator== (Symbol const &s) const noexcept
 
bool operator== (char const *s) const noexcept
 
template<typename S >
bool operator!= (S &&s) const noexcept
 
constexpr char const * str () const noexcept
 Return a string representation of this symbol. More...
 
constexpr char const * symbol () const noexcept
 Return the symbol string. More...
 
 operator char const * () const noexcept
 Return a string representation of this symbol. More...
 
constexpr bool valid () const noexcept
 Check if the symbol is valid. More...
 
 operator bool () const noexcept
 Check if the symbol is valid. More...
 

Detailed Description

A input/state symbol.

This is wrapper for a string literal.

Definition at line 165 of file fsm14.h.

Constructor & Destructor Documentation

◆ Symbol()

constexpr zth::fsm::Symbol::Symbol ( char const *  s = nullptr)
inlineconstexprnoexcept

Ctor.

Parameters
sthe string, or nullptr to create a default (invalid) Symbol.

Definition at line 172 of file fsm14.h.

Member Function Documentation

◆ constexpr_eq()

constexpr bool zth::fsm::Symbol::constexpr_eq ( Symbol const &  s) const
inlineconstexprnoexcept

Like == operator, but constexpr.

Definition at line 179 of file fsm14.h.

◆ operator bool()

zth::fsm::Symbol::operator bool ( ) const
inlinenoexcept

Check if the symbol is valid.

Definition at line 253 of file fsm14.h.

◆ operator char const *()

zth::fsm::Symbol::operator char const * ( ) const
inlinenoexcept

Return a string representation of this symbol.

Definition at line 237 of file fsm14.h.

◆ operator!=()

template<typename S >
bool zth::fsm::Symbol::operator!= ( S &&  s) const
inlinenoexcept

Definition at line 212 of file fsm14.h.

◆ operator==() [1/2]

bool zth::fsm::Symbol::operator== ( char const *  s) const
inlinenoexcept

Definition at line 206 of file fsm14.h.

◆ operator==() [2/2]

bool zth::fsm::Symbol::operator== ( Symbol const &  s) const
inlinenoexcept

Definition at line 201 of file fsm14.h.

◆ str()

constexpr char const* zth::fsm::Symbol::str ( ) const
inlineconstexprnoexcept

Return a string representation of this symbol.

Definition at line 220 of file fsm14.h.

◆ symbol()

constexpr char const* zth::fsm::Symbol::symbol ( ) const
inlineconstexprnoexcept

Return the symbol string.

Returns
nullptr in case of the default (invalid) Symbol

Definition at line 229 of file fsm14.h.

◆ valid()

constexpr bool zth::fsm::Symbol::valid ( ) const
inlineconstexprnoexcept

Check if the symbol is valid.

Definition at line 245 of file fsm14.h.


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