xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::config::Context Class Referenceabstract

A context used when loading skill elements. More...

#include <xentara/workbench/config/Context.hpp>

Classes

class  ReferenceKey
 A key used to resolve a cross reference in the configuration. More...
 

Public Member Functions

virtual ~Context ()=0
 Virtual destructor.
 

Resolving cross references

auto resolve (ReferenceKey key, std::reference_wrapper< model::ElementReference > variable) -> void
 Submits a request to resolve an element.
 
template<std::invocable PostHandler>
auto resolve (ReferenceKey key, std::reference_wrapper< model::ElementReference > variable, PostHandler postHandler) -> void
 Submits a request to resolve an element, specifying a post processing handler.
 
auto resolve (ReferenceKey key, std::reference_wrapper< model::AttributeReference > variable) -> void
 Submits a request to resolve an attribute.
 
template<std::invocable PostHandler>
auto resolve (ReferenceKey key, std::reference_wrapper< model::AttributeReference > variable, PostHandler postHandler) -> void
 Submits a request to resolve an attribute, specifying a post processing handler.
 
auto resolve (ReferenceKey key, std::reference_wrapper< process::EventReference > variable) -> void
 Submits a request to resolve an event.
 
template<std::invocable PostHandler>
auto resolve (ReferenceKey key, std::reference_wrapper< process::EventReference > variable, PostHandler postHandler) -> void
 Submits a request to resolve an event, specifying a post processing handler.
 
auto resolve (ReferenceKey key, std::reference_wrapper< process::TaskReference > variable) -> void
 Submits a request to resolve a task.
 
template<std::invocable PostHandler>
auto resolve (ReferenceKey key, std::reference_wrapper< process::TaskReference > variable, PostHandler postHandler) -> void
 Submits a request to resolve a task, specifying a post processing handler.
 
virtual auto doResolve (std::string &&key, std::reference_wrapper< model::internal::BasicElementReference > variable, std::function< auto() ->void > &&postHandler) -> void=0
 Resolves an element.
 
virtual auto doResolveMember (std::string &&key, std::reference_wrapper< model::internal::BasicElementReference > variable, std::function< auto() ->void > &&postHandler) -> void=0
 Resolves an element member.
 

Detailed Description

A context used when loading skill elements.

See also
skill::Element::load()

Constructor & Destructor Documentation

◆ ~Context()

xentara::workbench::config::Context::~Context ( )
pure virtualdefault

Virtual destructor.

Member Function Documentation

◆ doResolve()

virtual auto xentara::workbench::config::Context::doResolve ( std::string &&  key,
std::reference_wrapper< model::internal::BasicElementReference >  variable,
std::function< auto() -> void  ,
&&  postHandler 
) -> void
privatepure virtual

Resolves an element.

◆ doResolveMember()

virtual auto xentara::workbench::config::Context::doResolveMember ( std::string &&  key,
std::reference_wrapper< model::internal::BasicElementReference >  variable,
std::function< auto() -> void  ,
&&  postHandler 
) -> void
privatepure virtual

Resolves an element member.

◆ resolve() [1/8]

auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< model::AttributeReference variable 
) -> void

Submits a request to resolve an attribute.

This function submits a request to resolve a cross reference to an attribute using the given key. Once the cross reference has been resolved, it will be assigned to a variable.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to attributes of elements that have not been loaded yet.

To submit a request to resolve an attribute and store it in a member variable named *_referredAttribute*, for example, you can use the following code:

context.resolve<xentara::process::Attribute>(key, std::ref(_referredAttribute));
T ref(T... args)
Parameters
keyThe primary key of the attribute to resolve
variableA reference to the variable the resolved attribute should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.

◆ resolve() [2/8]

template<std::invocable PostHandler>
auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< model::AttributeReference variable,
PostHandler  postHandler 
) -> void

Submits a request to resolve an attribute, specifying a post processing handler.

This function submits a request to resolve a cross reference to an attribute using the given key. Once the cross reference has been resolved, it will be assigned to a variable. After assigning the variable, an additional handler will be called that allows some post processing to be done.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to attributes of elements that have not been loaded yet.

To submit a request to resolve an attribute and store it in a member variable named *_referredAttribute*, and then call the function postLoadReferredAttribute(), for example, you can use the following code:

context.resolve<xentara::process::Attribute>(key, std::ref(_referredAttribute), [this] { postLoadReferredAttribute(); });
Attention
If you are modifying any properties in the post handler, you must publish any changes you make using PropertyController::publish(). Alternatively, you can use PropertyController::setProperty(), which will publish the changes implicitly.
Parameters
keyThe primary key of the attribute to resolve
variableA reference to the variable the resolved attribute should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.
postHandlerA callback that will be called after the variable has been set.

◆ resolve() [3/8]

auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< model::ElementReference variable 
) -> void

Submits a request to resolve an element.

This function submits a request to resolve a cross reference to an element using the given key. Once the cross reference has been resolved, it will be assigned to a variable.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to elements that have not been loaded yet.

To submit a request to resolve a Xentara element and store it in a member variable named *_referredElement*, for example, you can use the following code:

context.resolve<xentara::model::Element>(key, std::ref(_referredElement));
Parameters
keyThe primary key of the element to resolve
variableA reference to the variable the resolved element should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.

◆ resolve() [4/8]

template<std::invocable PostHandler>
auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< model::ElementReference variable,
PostHandler  postHandler 
) -> void

Submits a request to resolve an element, specifying a post processing handler.

This function submits a request to resolve a cross reference to an element using the given key. Once the cross reference has been resolved, it will be assigned to a variable. After assigning the variable, an additional handler will be called that allows some post processing to be done.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to elements that have not been loaded yet.

To submit a request to resolve a Xentara element and store it in a member variable named *_referredElement*, and then call the function postLoadReferredElement(), for example, you can use the following code:

context.resolve<xentara::model::Element>(key, std::ref(_referredElement), [this] { postLoadReferredElement(); });
Attention
If you are modifying any properties in the post handler, you must publish any changes you make using PropertyController::publish(). Alternatively, you can use PropertyController::setProperty(), which will publish the changes implicitly.
Parameters
keyThe primary key of the element to resolve
variableA reference to the variable the resolved element should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.
postHandlerA callback that will be called after the variable has been set.

◆ resolve() [5/8]

auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< process::EventReference variable 
) -> void

Submits a request to resolve an event.

This function submits a request to resolve a cross reference to an event using the given key. Once the cross reference has been resolved, it will be assigned to a variable.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to events of elements that have not been loaded yet.

To submit a request to resolve an event and store it in a member variable named *_referredEvent*, for example, you can use the following code:

context.resolve<xentara::process::Event>(key, std::ref(_referredEvent));
Parameters
keyThe primary key of the event to resolve
variableA reference to the variable the resolved event should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.

◆ resolve() [6/8]

template<std::invocable PostHandler>
auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< process::EventReference variable,
PostHandler  postHandler 
) -> void

Submits a request to resolve an event, specifying a post processing handler.

This function submits a request to resolve a cross reference to an event using the given key. Once the cross reference has been resolved, it will be assigned to a variable. After assigning the variable, an additional handler will be called that allows some post processing to be done.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to events of elements that have not been loaded yet.

To submit a request to resolve an event and store it in a member variable named *_referredEvent*, and then call the function postLoadReferredEvent(), for example, you can use the following code:

context.resolve<xentara::process::Event>(key, std::ref(_referredEvent), [this] { postLoadReferredEvent(); });
Attention
If you are modifying any properties in the post handler, you must publish any changes you make using PropertyController::publish(). Alternatively, you can use PropertyController::setProperty(), which will publish the changes implicitly.
Parameters
keyThe primary key of the event to resolve
variableA reference to the variable the resolved event should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.
postHandlerA callback that will be called after the variable has been set.

◆ resolve() [7/8]

auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< process::TaskReference variable 
) -> void

Submits a request to resolve a task.

This function submits a request to resolve a cross reference to a task using the given key. Once the cross reference has been resolved, it will be assigned to a variable.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to tasks of elements that have not been loaded yet.

To submit a request to resolve a task and store it in a member variable named *_referredTask*, for example, you can use the following code:

context.resolve<xentara::process::Task>(key, std::ref(_referredTask));
Parameters
keyThe primary key of the task to resolve
variableA reference to the variable the resolved task should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.

◆ resolve() [8/8]

template<std::invocable PostHandler>
auto xentara::workbench::config::Context::resolve ( ReferenceKey  key,
std::reference_wrapper< process::TaskReference variable,
PostHandler  postHandler 
) -> void

Submits a request to resolve a task, specifying a post processing handler.

This function submits a request to resolve a cross reference to a task using the given key. Once the cross reference has been resolved, it will be assigned to a variable. After assigning the variable, an additional handler will be called that allows some post processing to be done.

The reference will not be resolved immediately, but only after the entire configuration has been loaded. This is necessary in order to be able to resolve references to tasks of elements that have not been loaded yet.

To submit a request to resolve a task and store it in a member variable named *_referredTask*, and then call the function postLoadReferredTask(), for example, you can use the following code:

context.resolve<xentara::process::Task>(key, std::ref(_referredTask), [this] { postLoadReferredTask(); });
Attention
If you are modifying any properties in the post handler, you must publish any changes you make using PropertyController::publish(). Alternatively, you can use PropertyController::setProperty(), which will publish the changes implicitly.
Parameters
keyThe primary key of the task to resolve
variableA reference to the variable the resolved task should be assigned to. The reference must remain valid during the entire loading of the Xentara model, not just the [load()](skill::Element::load()] function.
postHandlerA callback that will be called after the variable has been set.