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

Simplified spell base class. More...

#include <spell_extensible.hpp>

Inheritance diagram for rune_caster::spell_extensible< Input, Output >:
Collaboration diagram for rune_caster::spell_extensible< Input, Output >:

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)

Detailed Description

template<typename Input = RuneSequence, typename Output = Input>
class rune_caster::spell_extensible< Input, Output >

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.

Member Typedef Documentation

◆ input_type

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

Definition at line 30 of file spell_extensible.hpp.

◆ output_type

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

Definition at line 31 of file spell_extensible.hpp.

Constructor & Destructor Documentation

◆ spell_extensible()

template<typename Input = RuneSequence, typename Output = Input>
rune_caster::spell_extensible< Input, Output >::spell_extensible ( std::string name,
std::string desc )
inlineexplicit

Definition at line 34 of file spell_extensible.hpp.

Member Function Documentation

◆ description()

template<typename Input = RuneSequence, typename Output = Input>
std::string rune_caster::spell_extensible< Input, Output >::description ( ) const
inlineoverridevirtual

Get the spell's description.

Returns
A human-readable description of what the spell does

Implements rune_caster::spell_base< RuneSequence, RuneSequence >.

Definition at line 42 of file spell_extensible.hpp.

◆ name()

template<typename Input = RuneSequence, typename Output = Input>
std::string rune_caster::spell_extensible< Input, Output >::name ( ) const
inlineoverridevirtual

Get the spell's name.

Returns
A string identifying the spell

Implements rune_caster::spell_base< RuneSequence, RuneSequence >.

Definition at line 41 of file spell_extensible.hpp.

◆ operator()()

template<typename Input = RuneSequence, typename Output = Input>
output_type rune_caster::spell_extensible< Input, Output >::operator() ( const input_type & input) const
inlineoverride

Definition at line 38 of file spell_extensible.hpp.

◆ process()

template<typename Input = RuneSequence, typename Output = Input>
virtual output_type rune_caster::spell_extensible< Input, Output >::process ( const input_type & input) const
protectedpure virtual

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