Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
rune_caster::spell_base< Input, Output > Class Template Referenceabstract

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)

Detailed Description

template<typename Input, typename Output = Input>
class rune_caster::spell_base< Input, Output >

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.

Template Parameters
InputInput type for the spell
OutputOutput type for the spell (defaults to Input)

Definition at line 27 of file spell_base.hpp.

Member Typedef Documentation

◆ input_type

template<typename Input, typename Output = Input>
using rune_caster::spell_base< Input, Output >::input_type = Input

Definition at line 29 of file spell_base.hpp.

◆ output_type

template<typename Input, typename Output = Input>
using rune_caster::spell_base< Input, Output >::output_type = Output

Definition at line 30 of file spell_base.hpp.

Constructor & Destructor Documentation

◆ ~spell_base()

template<typename Input, typename Output = Input>
virtual rune_caster::spell_base< Input, Output >::~spell_base ( )
virtualdefault

Member Function Documentation

◆ can_process()

template<typename Input, typename Output = Input>
template<typename T>
constexpr bool rune_caster::spell_base< Input, Output >::can_process ( )
inlinestaticconstexprnoexcept

Check if this spell can be applied to the given input type (C++20 concepts)

Returns
true if the spell can process the input type

Definition at line 58 of file spell_base.hpp.

◆ description()

◆ input_type_name()

template<typename Input, typename Output = Input>
constexpr const char * rune_caster::spell_base< Input, Output >::input_type_name ( )
inlinestaticconstexprnoexcept

Get input type name as compile-time string (C++20)

Definition at line 73 of file spell_base.hpp.

◆ name()

◆ operator()()

◆ output_type_name()

template<typename Input, typename Output = Input>
constexpr const char * rune_caster::spell_base< Input, Output >::output_type_name ( )
inlinestaticconstexprnoexcept

Get output type name as compile-time string (C++20)

Definition at line 80 of file spell_base.hpp.

◆ produces()

template<typename Input, typename Output = Input>
template<typename T>
constexpr bool rune_caster::spell_base< Input, Output >::produces ( )
inlinestaticconstexprnoexcept

Check if this spell produces the expected output type (C++20 concepts)

Definition at line 66 of file spell_base.hpp.


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