Rune Caster 1.0.0
Modern C++ Text Processing Framework
|
Base interface for all spell algorithms with C++20 enhancements. More...
#include <spell_base.hpp>
Public Types | |
using | input_type = Input |
using | output_type = Output |
Public Member Functions | |
virtual | ~spell_base ()=default |
virtual output_type | operator() (const input_type &input) const =0 |
Apply the spell transformation. | |
virtual std::string | name () const =0 |
Get the spell's name. | |
virtual std::string | description () const =0 |
Get the spell's description. |
Static Public Member Functions | |
template<typename T> | |
static constexpr bool | can_process () noexcept |
Check if this spell can be applied to the given input type (C++20 concepts) | |
template<typename T> | |
static constexpr bool | produces () noexcept |
Check if this spell produces the expected output type (C++20 concepts) | |
static constexpr const char * | input_type_name () noexcept |
Get input type name as compile-time string (C++20) | |
static constexpr const char * | output_type_name () noexcept |
Get output type name as compile-time string (C++20) |
Base interface for all spell algorithms with C++20 enhancements.
This template class provides a common interface that all spell algorithms must implement, enabling polymorphic behavior and easy extensibility. Uses modern C++20 features for better compile-time checking.
Input | Input type for the spell |
Output | Output type for the spell (defaults to Input) |
Definition at line 27 of file spell_base.hpp.
using rune_caster::spell_base< Input, Output >::input_type = Input |
Definition at line 29 of file spell_base.hpp.
using rune_caster::spell_base< Input, Output >::output_type = Output |
Definition at line 30 of file spell_base.hpp.
|
virtualdefault |
|
inlinestaticconstexprnoexcept |
Check if this spell can be applied to the given input type (C++20 concepts)
Definition at line 58 of file spell_base.hpp.
|
pure virtual |
Get the spell's description.
Implemented in rune_caster::spell::CategoryFilter, rune_caster::spell::composition::SpellComposition< FirstSpell, SecondSpell >, rune_caster::spell::core::CaseConverter, rune_caster::spell::core::TrimEdges, rune_caster::spell::core::UnicodeNormalizer, rune_caster::spell::core::WhitespaceNormalizer, rune_caster::spell::core::WhitespaceTokenizer, rune_caster::spell::filter::CategoryFilter, rune_caster::spell::filter::PunctuationFilter, rune_caster::spell::filter::ScriptFilter, rune_caster::spell::language::GraphemeToPhoneme, rune_caster::spell::language::LanguageDetector, rune_caster::spell::PunctuationFilter, rune_caster::spell::ScriptFilter, rune_caster::spell::SpellComposition< FirstSpell, SecondSpell >, and rune_caster::spell_extensible< Input, Output >.
|
inlinestaticconstexprnoexcept |
Get input type name as compile-time string (C++20)
Definition at line 73 of file spell_base.hpp.
|
pure virtual |
Get the spell's name.
Implemented in rune_caster::spell::CategoryFilter, rune_caster::spell::composition::SpellComposition< FirstSpell, SecondSpell >, rune_caster::spell::core::CaseConverter, rune_caster::spell::core::TrimEdges, rune_caster::spell::core::UnicodeNormalizer, rune_caster::spell::core::WhitespaceNormalizer, rune_caster::spell::core::WhitespaceTokenizer, rune_caster::spell::filter::CategoryFilter, rune_caster::spell::filter::PunctuationFilter, rune_caster::spell::filter::ScriptFilter, rune_caster::spell::language::GraphemeToPhoneme, rune_caster::spell::language::LanguageDetector, rune_caster::spell::PunctuationFilter, rune_caster::spell::ScriptFilter, rune_caster::spell::SpellComposition< FirstSpell, SecondSpell >, and rune_caster::spell_extensible< Input, Output >.
|
pure virtual |
Apply the spell transformation.
input | The input data to transform |
Implemented in rune_caster::spell::CategoryFilter, rune_caster::spell::core::CaseConverter, rune_caster::spell::core::TrimEdges, rune_caster::spell::core::UnicodeNormalizer, rune_caster::spell::core::WhitespaceNormalizer, rune_caster::spell::core::WhitespaceTokenizer, rune_caster::spell::filter::CategoryFilter, rune_caster::spell::filter::PunctuationFilter, rune_caster::spell::filter::ScriptFilter, rune_caster::spell::language::GraphemeToPhoneme, rune_caster::spell::language::LanguageDetector, rune_caster::spell::PunctuationFilter, and rune_caster::spell::ScriptFilter.
|
inlinestaticconstexprnoexcept |
Get output type name as compile-time string (C++20)
Definition at line 80 of file spell_base.hpp.
|
inlinestaticconstexprnoexcept |
Check if this spell produces the expected output type (C++20 concepts)
Definition at line 66 of file spell_base.hpp.