xentara-plugin v1.2.1
The Xentara Plugin Framework
|
An object used to resolve cross references in a configuration. More...
#include <config/Resolver.hpp>
Public Member Functions | |
Submitting Requests Using JSON Values | |
template<typename Object , typename Reference > requires std::is_assignable_v<Reference &, const std::reference_wrapper<Object> &> | |
auto | submit (utils::json::decoder::Value &key, std::reference_wrapper< Reference > reference) -> void |
Submits a request to resolve a reference using a key stored in a JSON value. | |
template<typename Object , typename Pointer > requires std::is_assignable_v<Pointer &, Object *> | |
auto | submit (utils::json::decoder::Value &key, std::reference_wrapper< Pointer > pointer) -> void |
Submits a request to resolve a pointer using a key stored in a JSON value. | |
template<typename Object , std::invocable< std::reference_wrapper< Object > > Handler> | |
auto | submit (utils::json::decoder::Value &key, Handler handler) -> void |
Submits a request to resolve a reference using a handler using a key stored in a JSON value. | |
template<typename Object , typename SharedPointer > requires std::is_assignable_v<SharedPointer &, const std::shared_ptr<Object> &> | |
auto | submit (utils::json::decoder::Value &key, std::reference_wrapper< SharedPointer > pointer) -> void |
Submits a request to resolve a reference held in a shared pointer using a key stored in a JSON value. | |
template<typename Object , std::invocable< const std::shared_ptr< Object > & > Handler> | |
auto | submit (utils::json::decoder::Value &key, Handler handler) -> void |
Submits a request to resolve a reference held in a shared pointer using a handler using a key stored in a JSON value. | |
template<typename Object , typename SubReference > requires std::is_assignable_v<SubReference &, const model::SubReference<Object> &> | |
auto | submit (utils::json::decoder::Value &key, std::reference_wrapper< SubReference > reference) -> void |
Submits a request to resolve a reference held as a sub reference using a key stored in a JSON value. | |
template<typename Object , std::invocable< const model::SubReference< Object > & > Handler> | |
auto | submit (utils::json::decoder::Value &key, Handler handler) -> void |
Submits a request to resolve a reference held as a sub reference using a handler using a key stored in a JSON value. | |
Submitting Requests Tied to Arbitrary JSON Document Locations | |
template<typename Object , typename Reference > requires std::is_assignable_v<Reference &, const std::reference_wrapper<Object> &> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, std::reference_wrapper< Reference > reference) -> void |
Submits a request to resolve a reference based on a JSON value. | |
template<typename Object , typename Pointer > requires std::is_assignable_v<Pointer &, Object *> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, std::reference_wrapper< Pointer > pointer) -> void |
Submits a request to resolve a pointer based on a JSON value. | |
template<typename Object , std::invocable< std::reference_wrapper< Object > > Handler> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, Handler handler) -> void |
Submits a request to resolve a reference using a handler based on a JSON value. | |
template<typename Object , typename SharedPointer > requires std::is_assignable_v<SharedPointer &, const std::shared_ptr<Object> &> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, std::reference_wrapper< SharedPointer > pointer) -> void |
Submits a request to resolve a reference held in a shared pointer based on a JSON value. | |
template<typename Object , std::invocable< const std::shared_ptr< Object > & > Handler> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, Handler handler) -> void |
Submits a request to resolve a reference held in a shared pointer using a handler based on a JSON value. | |
template<typename Object , typename SubReference > requires std::is_assignable_v<SubReference &, const model::SubReference<Object> &> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, std::reference_wrapper< SubReference > reference) -> void |
Submits a request to resolve a reference held as a sub reference based on a JSON value. | |
template<typename Object , std::invocable< const model::SubReference< Object > & > Handler> | |
auto | submit (std::string_view key, const utils::json::decoder::Location &location, Handler handler) -> void |
Submits a request to resolve a reference held as a sub reference using a handler based on a JSON value. | |
Submitting Requests not Based on JSON Values | |
template<typename Object , typename Reference > requires std::is_assignable_v<Reference &, const std::reference_wrapper<Object> &> | |
auto | submit (std::string_view key, std::reference_wrapper< Reference > reference) -> void |
Submits a request to resolve a reference. | |
template<typename Object , typename Pointer > requires std::is_assignable_v<Pointer &, Object *> | |
auto | submit (std::string_view key, std::reference_wrapper< Pointer > pointer) -> void |
Submits a request to resolve a pointer. | |
template<typename Object , std::invocable< std::reference_wrapper< Object > > Handler> | |
auto | submit (std::string_view key, Handler handler) -> void |
Submits a request to resolve a reference using a handler. | |
template<typename Object , typename SharedPointer > requires std::is_assignable_v<SharedPointer &, const std::shared_ptr<Object> &> | |
auto | submit (std::string_view key, std::reference_wrapper< SharedPointer > pointer) -> void |
Submits a request to resolve a reference held in a shared pointer. | |
template<typename Object , std::invocable< const std::shared_ptr< Object > & > Handler> | |
auto | submit (std::string_view key, Handler handler) -> void |
Submits a request to resolve a reference held in a shared pointer using a handler. | |
template<typename Object , typename SubReference > requires std::is_assignable_v<SubReference &, const model::SubReference<Object> &> | |
auto | submit (std::string_view key, std::reference_wrapper< SubReference > reference) -> void |
Submits a request to resolve a reference held as a sub reference. | |
template<typename Object , std::invocable< const model::SubReference< Object > & > Handler> | |
auto | submit (std::string_view key, Handler handler) -> void |
Submits a request to resolve a reference held as a sub reference using a handler. | |
An object used to resolve cross references in a configuration.
If you need to resolve a reference to another object in the configuration, you must submit a request to this resolver, that the reference be resolved when the object is loaded. This allows you to obtein a cross reference to an object that has not yet been loaded.
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference using a handler based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, the given handler will be called with a const std::reference_wrapper<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
handler | The handler that will handle the reference |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference held in a shared pointer using a handler based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, the given handler will be called with a const std::shared_ptr<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
handler | The handler that will handle the reference |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference held as a sub reference using a handler based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, the given handler will be called with a const model::SubReference<Object> & as if by:
Object | The most derived type of object to resolve. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
handler | The handler that will handle the reference |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
std::reference_wrapper< Pointer > | pointer | ||
) | -> void |
Submits a request to resolve a pointer based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using an Object * as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
pointer | A reference to the variable that should be assigned the pointer. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
std::reference_wrapper< Reference > | reference | ||
) | -> void |
Submits a request to resolve a reference based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using a const std::reference_wrapper<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
reference | A reference to the variable that should be assigned the reference.. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
utils::json::decoder::TypeMismatchError | key is not a string value |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
std::reference_wrapper< SharedPointer > | pointer | ||
) | -> void |
Submits a request to resolve a reference held in a shared pointer based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using a const std::shared_ptr<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
pointer | A reference to the variable that should be assigned the shared pointer. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
const utils::json::decoder::Location & | location, | ||
std::reference_wrapper< SubReference > | reference | ||
) | -> void |
Submits a request to resolve a reference held as a sub reference based on a JSON value.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using a const model::SubReference<Object> & as if by:
Object | The most derived type of object to resolve. |
key | The key used to identify the object, in UTF-8 encoding |
location | The location within the JSON document that the key was taken from. This is used to output the line number in error messages. |
reference | A reference to the variable that should be assigned a copy of the reference. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference using a handler.
This function submits a request to resolve the object with the given key. Once the object has been resolved, the given handler will be called with a const std::reference_wrapper<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
handler | The handler that will handle the reference |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference held in a shared pointer using a handler.
This function submits a request to resolve the object with the given key. Once the object has been resolved, the given handler will be called with a const std::shared_ptr<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
handler | The handler that will handle the reference |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference held as a sub reference using a handler.
This function submits a request to resolve the object with the given key. Once the object has been resolved, the given handler will be called with a const model::SubReference<Object> & as if by:
Object | The most derived type of object to resolve. |
key | The key used to identify the object, in UTF-8 encoding |
handler | The handler that will handle the reference |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
std::reference_wrapper< Pointer > | pointer | ||
) | -> void |
Submits a request to resolve a pointer.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using an Object * as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
pointer | A reference to the variable that should be assigned the pointer. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
std::reference_wrapper< Reference > | reference | ||
) | -> void |
Submits a request to resolve a reference.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using a const std::reference_wrapper<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
reference | A reference to the variable that should be assigned the reference. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
std::reference_wrapper< SharedPointer > | pointer | ||
) | -> void |
Submits a request to resolve a reference held in a shared pointer.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using a const std::shared_ptr<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The key used to identify the object, in UTF-8 encoding |
pointer | A reference to the variable that should be assigned the shared pointer. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | std::string_view | key, |
std::reference_wrapper< SubReference > | reference | ||
) | -> void |
Submits a request to resolve a reference held as a sub reference.
This function submits a request to resolve the object with the given key. Once the object has been resolved, it will be assigned to the reference using a const model::SubReference<Object> & as if by:
Object | The most derived type of object to resolve. |
key | The key used to identify the object, in UTF-8 encoding |
reference | A reference to the variable that should be assigned a copy of the reference. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference using a handler using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, the given handler will be called with a const std::reference_wrapper<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The JSON value containing the key used to identify the object |
handler | The handler that will handle the reference |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference held in a shared pointer using a handler using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, the given handler will be called with a const std::shared_ptr<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The JSON value containing the key used to identify the object |
handler | The handler that will handle the reference |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
Handler | handler | ||
) | -> void |
Submits a request to resolve a reference held as a sub reference using a handler using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, the given handler will be called with a const model::SubReference<Object> & as if by:
Object | The most derived type of object to resolve. |
key | The JSON value containing the key used to identify the object |
handler | The handler that will handle the reference |
std::runtime_error | An error occurred reading the key from the JSON document |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
std::reference_wrapper< Pointer > | pointer | ||
) | -> void |
Submits a request to resolve a pointer using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, it will be assigned to the reference using an Object * as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The JSON value containing the key used to identify the object |
pointer | A reference to the variable that should be assigned the pointer. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
std::reference_wrapper< Reference > | reference | ||
) | -> void |
Submits a request to resolve a reference using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, it will be assigned to the reference using a const std::reference_wrapper<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The JSON value containing the key used to identify the object |
reference | A reference to the variable that should be assigned the reference. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
utils::json::decoder::TypeMismatchError | key is not a string value |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
std::reference_wrapper< SharedPointer > | pointer | ||
) | -> void |
Submits a request to resolve a reference held in a shared pointer using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, it will be assigned to the reference using a const std::shared_ptr<Object> & as if by:
Object | The type of object to resolve. This must be the most derived type, or xentara::model::GenericElement to resolve a generic element within a Xentara model. |
key | The JSON value containing the key used to identify the object |
pointer | A reference to the variable that should be assigned the shared pointer. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
utils::json::decoder::TypeMismatchError | key is not a string value |
std::runtime_error | An error occurred reading the key from the JSON document |
auto xentara::config::Resolver::submit | ( | utils::json::decoder::Value & | key, |
std::reference_wrapper< SubReference > | reference | ||
) | -> void |
Submits a request to resolve a reference held as a sub reference using a key stored in a JSON value.
This function submits a request to resolve the object with the key contained in the JSON value key. Once the object has been resolved, it will be assigned to the reference using a const model::SubReference<Object> & as if by:
Object | The most derived type of object to resolve. |
key | The JSON value containing the key used to identify the object |
reference | A reference to the variable that should be assigned a copy of the reference. To enable the compiler to select the correct overload, you should pass this parameter using std::ref. |
std::runtime_error | An error occurred reading the key from the JSON document |