xentara-plugin v2.0.4
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::config::CustomResolver< Reference >::Committer Class Referencefinal

Object for custom handling. More...

#include <xentara/config/CustomResolver.hpp>

Public Member Functions

 Committer (CustomResolver &resolver)
 Creates an object for handling the requests of a specific resolver.
 
 ~Committer () noexcept(false)
 Destructor.
 
auto handle (std::string_view key, Reference object)
 Handles the submitted requests for a specific object.
 
auto finish ()
 Finishes the handling.
 

Detailed Description

template<typename Reference>
class xentara::config::CustomResolver< Reference >::Committer

Object for custom handling.

Constructor & Destructor Documentation

◆ Committer()

template<typename Reference >
xentara::config::CustomResolver< Reference >::Committer::Committer ( CustomResolver resolver)

Creates an object for handling the requests of a specific resolver.

Parameters
resolverThe resolver

◆ ~Committer()

template<typename Reference >
xentara::config::CustomResolver< Reference >::Committer::~Committer ( )

Destructor.

This destructor will throw any pending exceptions if the termination cannot be written. To prevent termination of the program, no exceptions are thrown during stack windup, though. You can prevent the destructor from throwing any exceptions by finishing the process manually beforehand using finish().

Exceptions
std::runtime_errorAn error occurred writing to the stream

Member Function Documentation

◆ finish()

template<typename Reference >
auto xentara::config::CustomResolver< Reference >::Committer::finish ( )

Finishes the handling.

This function must can be called to finish the committing before the destructor is called. This will throw any pending exceptions right away, instead of in the destructor.

◆ handle()

template<typename Reference >
auto xentara::config::CustomResolver< Reference >::Committer::handle ( std::string_view  key,
Reference  object 
)

Handles the submitted requests for a specific object.

This function allows you to implement your own commit logic. You must call this function once for each object that can be resolved. You must call finishCommit() after all objects have been committed.