Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
rune_caster::spell::CustomSpell< Func > Class Template Reference

Create a custom spell from a lambda function. More...

#include <spell.hpp>

Inheritance diagram for rune_caster::spell::CustomSpell< Func >:
Collaboration diagram for rune_caster::spell::CustomSpell< Func >:

Public Member Functions

 CustomSpell (std::string name, std::string desc, Func func)
Public Member Functions inherited from rune_caster::spell_extensible< Input, Output >
 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.

Additional Inherited Members

Public Types inherited from rune_caster::spell_extensible< Input, Output >
using input_type = Input
using output_type = Output
Public Types inherited from rune_caster::spell_base< RuneSequence, RuneSequence >
using input_type
using output_type
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)
Protected Member Functions inherited from rune_caster::spell_extensible< Input, Output >
virtual output_type process (const input_type &input) const =0

Detailed Description

template<typename Func>
class rune_caster::spell::CustomSpell< Func >

Create a custom spell from a lambda function.

auto my_spell = spell::custom("MySpell", "Description", [](const RuneSequence& input) {
// Your transformation logic here
return input;
});
auto custom(std::string name, std::string description, Func &&func)
Create a custom spell from a function.
Definition spell.hpp:211
RuneString RuneSequence
Backward compatibility alias for RuneString.

Definition at line 193 of file spell.hpp.

Constructor & Destructor Documentation

◆ CustomSpell()

template<typename Func>
rune_caster::spell::CustomSpell< Func >::CustomSpell ( std::string name,
std::string desc,
Func func )
inline

Definition at line 198 of file spell.hpp.


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