Rune Caster 1.0.0
Modern C++ Text Processing Framework
|
Composition of two spells into a single spell pipeline. More...
#include <spell_composition.hpp>
Public Types | |
using | input_type = typename FirstSpell::input_type |
using | output_type = typename SecondSpell::output_type |
Public Types inherited from rune_caster::spell_base< RuneSequence > | |
using | input_type |
using | output_type |
Public Member Functions | |
constexpr | SpellComposition (FirstSpell first, SecondSpell second) |
Construct a spell composition. | |
output_type | operator() (const input_type &input) const override |
Apply the composed spells. | |
std::string | description () const override |
Get the spell's description. | |
std::string | name () const override |
Get the spell's name. | |
const FirstSpell & | first_spell () const noexcept |
Get the first spell in the composition. | |
const SecondSpell & | second_spell () const noexcept |
Get the second spell in the composition. | |
Public Member Functions inherited from rune_caster::spell_base< RuneSequence > | |
virtual | ~spell_base ()=default |
virtual output_type | operator() (const input_type &input) const=0 |
Apply the spell transformation. |
Additional Inherited Members | |
Static Public Member Functions inherited from rune_caster::spell_base< RuneSequence > | |
static constexpr bool | can_process () noexcept |
Check if this spell can be applied to the given input type (C++20 concepts) | |
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) |
Composition of two spells into a single spell pipeline.
This class allows chaining two spells together, where the output of the first spell becomes the input of the second spell. Uses C++20 concepts for type safety.
FirstSpell | The first spell in the composition |
SecondSpell | The second spell in the composition |
Definition at line 23 of file spell_composition.hpp.
using rune_caster::spell::composition::SpellComposition< FirstSpell, SecondSpell >::input_type = typename FirstSpell::input_type |
Definition at line 34 of file spell_composition.hpp.
using rune_caster::spell::composition::SpellComposition< FirstSpell, SecondSpell >::output_type = typename SecondSpell::output_type |
Definition at line 35 of file spell_composition.hpp.
|
inlineconstexpr |
Construct a spell composition.
first | The first spell to apply |
second | The second spell to apply |
Definition at line 42 of file spell_composition.hpp.
|
inlineoverridevirtual |
Get the spell's description.
Implements rune_caster::spell_base< RuneSequence >.
Definition at line 61 of file spell_composition.hpp.
|
inlinenoexcept |
Get the first spell in the composition.
Definition at line 72 of file spell_composition.hpp.
|
inlineoverridevirtual |
Get the spell's name.
Implements rune_caster::spell_base< RuneSequence >.
Definition at line 65 of file spell_composition.hpp.
|
inlineoverride |
Apply the composed spells.
input | The input to transform |
Definition at line 56 of file spell_composition.hpp.
|
inlinenoexcept |
Get the second spell in the composition.
Definition at line 77 of file spell_composition.hpp.