Rune Caster 1.0.0
Modern C++ Text Processing Framework
|
Simplified spell base class. More...
#include <spell_extensible.hpp>
Public Types | |
using | input_type = Input |
using | output_type = Output |
Public Types inherited from rune_caster::spell_base< RuneSequence, RuneSequence > | |
using | input_type |
using | output_type |
Public Member Functions | |
spell_extensible (std::string name, std::string desc) | |
output_type | operator() (const input_type &input) const override |
std::string | name () const override |
Get the spell's name. | |
std::string | description () const override |
Get the spell's description. | |
Public Member Functions inherited from rune_caster::spell_base< RuneSequence, RuneSequence > | |
virtual | ~spell_base ()=default |
virtual output_type | operator() (const input_type &input) const=0 |
Apply the spell transformation. |
Protected Member Functions | |
virtual output_type | process (const input_type &input) const =0 |
Additional Inherited Members | |
Static Public Member Functions inherited from rune_caster::spell_base< RuneSequence, 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) |
Simplified spell base class.
Developers inherit from this class when they just want to implement the core transformation logic via process() without re-implementing operator() or boilerplate metadata accessors. It keeps full compatibility with the existing spell_base / caster pipeline and STL functional usage.
Example: class MySpell : public rune_caster::spell_extensible<> { public: MySpell() : spell_extensible{"MySpell", "Demo spell"} {} private: RuneSequence process(const RuneSequence& in) const override { // ... transform ... } };
Definition at line 28 of file spell_extensible.hpp.
using rune_caster::spell_extensible< Input, Output >::input_type = Input |
Definition at line 30 of file spell_extensible.hpp.
using rune_caster::spell_extensible< Input, Output >::output_type = Output |
Definition at line 31 of file spell_extensible.hpp.
|
inlineexplicit |
Definition at line 34 of file spell_extensible.hpp.
|
inlineoverridevirtual |
Get the spell's description.
Implements rune_caster::spell_base< RuneSequence, RuneSequence >.
Definition at line 42 of file spell_extensible.hpp.
|
inlineoverridevirtual |
Get the spell's name.
Implements rune_caster::spell_base< RuneSequence, RuneSequence >.
Definition at line 41 of file spell_extensible.hpp.
|
inlineoverride |
Definition at line 38 of file spell_extensible.hpp.
|
protectedpure virtual |