xentara-plugin v2.0.4
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::skill::Skill::Class Class Referenceabstract

Meta-Information about a skill class. More...

#include <xentara/skill/Skill.hpp>

+ Inheritance diagram for xentara::skill::Skill::Class:

Classes

class  Registry
 A registry for the element classes. More...
 

Public Member Functions

virtual ~Class ()=0
 Virtual destructor.
 
virtual auto name () const -> std::string_view=0
 Gets the name of the skill.
 
virtual auto uuid () const -> utils::core::Uuid=0
 Gets the UUID of the skill.
 
virtual auto registerElements (Registry &registry) -> void=0
 Called by the framework to register all element classes and other features the skill provides.
 
virtual auto createSkill () -> std::unique_ptr< Skill >=0
 Called by the framework to create the actual skill.
 
- Public Member Functions inherited from xentara::utils::tools::DisableCopy
constexpr DisableCopy () noexcept=default
 
 DisableCopy (const DisableCopy &)=delete
 
DisableCopyoperator= (const DisableCopy &)=delete
 

Detailed Description

Meta-Information about a skill class.

Each skill must have a single skill object derived from this class. The object must have static storage duration, meaning it must be a static member variable or a global variable.

Constructor & Destructor Documentation

◆ ~Class()

xentara::skill::Skill::Class::~Class ( )
pure virtualdefault

Virtual destructor.

Member Function Documentation

◆ createSkill()

virtual auto xentara::skill::Skill::Class::createSkill ( ) -> std::unique_ptr< Skill >
pure virtual

Called by the framework to create the actual skill.

Returns
The newly created skill. Must never return nullptr.
Exceptions
std::runtime_exceptionImplementations can throw this exception (or a suitable subclass) if an error occurs.

Implemented in xentara::io::Driver, and xentara::process::ServiceProvider.

◆ name()

virtual auto xentara::skill::Skill::Class::name ( ) const -> std::string_view
pure virtual

Gets the name of the skill.

Returns
The name of the skill, in UTF-8 encoding.

Implemented in xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >.

◆ registerElements()

virtual auto xentara::skill::Skill::Class::registerElements ( Registry registry) -> void
pure virtual

Called by the framework to register all element classes and other features the skill provides.

Parameters
registryThe registry that should be used to register the skill classes

Implemented in xentara::io::Driver, xentara::process::ServiceProvider, and xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >.

◆ uuid()

virtual auto xentara::skill::Skill::Class::uuid ( ) const -> utils::core::Uuid
pure virtual