xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::config::Resolver Class Referencefinal

An object used to resolve cross references in a configuration. More...

#include <config/Resolver.hpp>

+ Inheritance diagram for xentara::config::Resolver:

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.
 

Detailed Description

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.

See also
Resolving Cross References
Examples
LoadingElementConfig.cpp, and PublishingConfigAttributes.cpp.

Member Function Documentation

◆ submit() [1/21]

template<typename Object , std::invocable< std::reference_wrapper< Object > > Handler>
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:

const std::reference_wrapper<Object> object = resolveObjectInSomeMysteriousWay(key);
handler.get()(object);
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
handlerThe handler that will handle the reference
See also
Resolving Cross References

◆ submit() [2/21]

template<typename Object , std::invocable< const std::shared_ptr< Object > & > Handler>
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:

const std::shared_ptr<Object> object = resolveObjectInSomeMysteriousWay(key);
handler.get()(object);
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
handlerThe handler that will handle the reference
See also
Resolving Cross References

◆ submit() [3/21]

template<typename Object , std::invocable< const model::SubReference< Object > & > Handler>
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:

const xentara::model::SubReference<Object> object = resolveObjectInSomeMysteriousWay(key);
handler.get()(object);
A refrence to a sub object a Xentara element.
Definition Resolver.hpp:26
Template Parameters
ObjectThe most derived type of object to resolve.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
handlerThe handler that will handle the reference
See also
model::SubReference, model::AttributeReference
Resolving Cross References

◆ submit() [4/21]

template<typename Object , typename Pointer >
requires std::is_assignable_v<Pointer &, Object *>
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 *const object = resolveObjectInSomeMysteriousWay(key);
pointer.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
pointerA 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.
See also
Resolving Cross References

◆ submit() [5/21]

template<typename Object , typename Reference >
requires std::is_assignable_v<Reference &, const std::reference_wrapper<Object> &>
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:

const std::reference_wrapper<Object> object = resolveObjectInSomeMysteriousWay(key);
reference.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
referenceA 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.
Exceptions
utils::json::decoder::TypeMismatchErrorkey is not a string value
See also
Resolving Cross References
Examples
LoadingElementConfig.cpp

◆ submit() [6/21]

template<typename Object , typename SharedPointer >
requires std::is_assignable_v<SharedPointer &, const std::shared_ptr<Object> &>
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:

const std::shared_ptr<Object> object = resolveObjectInSomeMysteriousWay(key);
reference.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
pointerA 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.
See also
Resolving Cross References

◆ submit() [7/21]

template<typename Object , typename SubReference >
requires std::is_assignable_v<SubReference &, const model::SubReference<Object> &>
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:

const xentara::model::SubReference<Object> object = resolveObjectInSomeMysteriousWay(key);
reference.get() = object;
Template Parameters
ObjectThe most derived type of object to resolve.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
locationThe location within the JSON document that the key was taken from. This is used to output the line number in error messages.
referenceA 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.
See also
model::SubReference, model::AttributeReference
Resolving Cross References

◆ submit() [8/21]

template<typename Object , std::invocable< std::reference_wrapper< Object > > Handler>
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:

const std::reference_wrapper<Object> object = resolveObjectInSomeMysteriousWay(key);
handler.get()(object);
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
handlerThe handler that will handle the reference
See also
Resolving Cross References

◆ submit() [9/21]

template<typename Object , std::invocable< const std::shared_ptr< Object > & > Handler>
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:

const std::shared_ptr<Object> object = resolveObjectInSomeMysteriousWay(key);
handler.get()(object);
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
handlerThe handler that will handle the reference
See also
Resolving Cross References

◆ submit() [10/21]

template<typename Object , std::invocable< const model::SubReference< Object > & > Handler>
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:

const xentara::model::SubReference<Object> object = resolveObjectInSomeMysteriousWay(key);
handler.get()(object);
Template Parameters
ObjectThe most derived type of object to resolve.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
handlerThe handler that will handle the reference
See also
model::SubReference, model::AttributeReference
Resolving Cross References

◆ submit() [11/21]

template<typename Object , typename Pointer >
requires std::is_assignable_v<Pointer &, Object *>
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 *const object = resolveObjectInSomeMysteriousWay(key);
pointer.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
pointerA 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.
See also
Resolving Cross References

◆ submit() [12/21]

template<typename Object , typename Reference >
requires std::is_assignable_v<Reference &, const std::reference_wrapper<Object> &>
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:

const std::reference_wrapper<Object> object = resolveObjectInSomeMysteriousWay(key);
reference.get() = object;
Template Parameters
ObjectThe 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.
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
referenceA 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.
See also
Resolving Cross References

◆ submit() [13/21]

template<typename Object , typename SharedPointer >
requires std::is_assignable_v<SharedPointer &, const std::shared_ptr<Object> &>
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:

const std::shared_ptr<Object> object = resolveObjectInSomeMysteriousWay(key);
reference.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
pointerA 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.
See also
Resolving Cross References

◆ submit() [14/21]

template<typename Object , typename SubReference >
requires std::is_assignable_v<SubReference &, const model::SubReference<Object> &>
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:

const xentara::model::SubReference<Object> object = resolveObjectInSomeMysteriousWay(key);
reference.get() = object;
Template Parameters
ObjectThe most derived type of object to resolve.
Parameters
keyThe key used to identify the object, in UTF-8 encoding
referenceA 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.
See also
model::SubReference, model::AttributeReference
Resolving Cross References

◆ submit() [15/21]

template<typename Object , std::invocable< std::reference_wrapper< Object > > Handler>
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:

const std::reference_wrapper<Object> object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
handler.get()(object);
Template Parameters
ObjectThe 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.
Parameters
keyThe JSON value containing the key used to identify the object
handlerThe handler that will handle the reference
Exceptions
utils::json::decoder::TypeMismatchErrorkey is not a string value
std::runtime_errorAn error occurred reading the key from the JSON document
See also
Resolving Cross References

◆ submit() [16/21]

template<typename Object , std::invocable< const std::shared_ptr< Object > & > Handler>
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:

const std::shared_ptr<Object> object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
handler.get()(object);
Template Parameters
ObjectThe 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.
Parameters
keyThe JSON value containing the key used to identify the object
handlerThe handler that will handle the reference
Exceptions
utils::json::decoder::TypeMismatchErrorkey is not a string value
std::runtime_errorAn error occurred reading the key from the JSON document
See also
Resolving Cross References

◆ submit() [17/21]

template<typename Object , std::invocable< const model::SubReference< Object > & > Handler>
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:

const xentara::model::SubReference<Object> object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
handler.get()(object);
Template Parameters
ObjectThe most derived type of object to resolve.
Parameters
keyThe JSON value containing the key used to identify the object
handlerThe handler that will handle the reference
Exceptions
std::runtime_errorAn error occurred reading the key from the JSON document
See also
model::SubReference, model::AttributeReference
Resolving Cross References

◆ submit() [18/21]

template<typename Object , typename Pointer >
requires std::is_assignable_v<Pointer &, Object *>
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 *const object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
pointer.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe JSON value containing the key used to identify the object
pointerA 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.
Exceptions
utils::json::decoder::TypeMismatchErrorkey is not a string value
std::runtime_errorAn error occurred reading the key from the JSON document
See also
Resolving Cross References

◆ submit() [19/21]

template<typename Object , typename Reference >
requires std::is_assignable_v<Reference &, const std::reference_wrapper<Object> &>
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:

const std::reference_wrapper<Object> object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
reference.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe JSON value containing the key used to identify the object
referenceA 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.
Exceptions
utils::json::decoder::TypeMismatchErrorkey is not a string value
See also
Resolving Cross References

◆ submit() [20/21]

template<typename Object , typename SharedPointer >
requires std::is_assignable_v<SharedPointer &, const std::shared_ptr<Object> &>
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:

const std::shared_ptr<Object> object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
reference.get() = object;
Template Parameters
ObjectThe 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.
Parameters
keyThe JSON value containing the key used to identify the object
pointerA 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.
Exceptions
utils::json::decoder::TypeMismatchErrorkey is not a string value
std::runtime_errorAn error occurred reading the key from the JSON document
See also
Resolving Cross References
Examples
LoadingElementConfig.cpp

◆ submit() [21/21]

template<typename Object , typename SubReference >
requires std::is_assignable_v<SubReference &, const model::SubReference<Object> &>
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:

const xentara::model::SubReference<Object> object = resolveObjectInSomeMysteriousWay(key.asString<std::string>());
reference.get() = object;
Template Parameters
ObjectThe most derived type of object to resolve.
Parameters
keyThe JSON value containing the key used to identify the object
referenceA 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.
Exceptions
std::runtime_errorAn error occurred reading the key from the JSON document
See also
model::SubReference, model::AttributeReference
Resolving Cross References