xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::process::EventReference Class Referencefinal

A reference to an event belonging to a Xentara element. More...

#include <xentara/workbench/process/EventReference.hpp>

+ Inheritance diagram for xentara::workbench::process::EventReference:

Classes

class  ImportReference
 A light-weight object that can be used to generate event references when importing elements using an [import button](bindings::ImportButton]. More...
 

Public Member Functions

 EventReference (EventSearchOptions options={})
 Constructor.
 
 EventReference (const EventReference &other)=default
 Copy constructor.
 
 EventReference (EventReference &&other) noexcept=default
 Move constructor.
 
 EventReference (const EventReference &other, EventSearchOptions options) noexcept
 Copy constructor that copies the referred event but uses explicit options.
 
 EventReference (EventReference &&other, EventSearchOptions options)
 Move constructor that moves the referred event but uses explicit options.
 
auto operator= (const EventReference &rhs) -> EventReference &
 Assignment operator.
 
auto operator= (EventReference &&rhs) noexcept -> EventReference &
 Move-Assignment operator.
 
internal operator bool () const noexcept
 Checks whether the reference points to anything.
 
auto event () const -> utils::eh::expected< process::Event, ui::String >
 Gets the event.
 
auto primaryKey () const -> std::string
 Gets the primary key of the event.
 
auto save (utils::json::encoder::Value &jsonValue) const -> void
 Writes the reference to a JSON value.
 
auto saveTo (utils::json::encoder::Object &jsonObject, std::string_view name) const -> void
 Adds the reference to a JSON object.
 
auto saveTo (utils::json::encoder::Array &jsonArray) const -> void
 Writes the reference to a JSON array.
 
- Public Member Functions inherited from xentara::workbench::bindings::CrossReferenceController
 CrossReferenceController () noexcept=default
 Default constructor.
 
 CrossReferenceController (const CrossReferenceController &other)
 Copy constructor.
 
 CrossReferenceController (CrossReferenceController &&other) noexcept
 Move constructor.
 
virtual ~CrossReferenceController ()=0
 Virtual destructor.
 
auto operator= (const CrossReferenceController &rhs) -> CrossReferenceController &
 Copy assignment operator.
 
auto operator= (CrossReferenceController &&rhs) noexcept -> CrossReferenceController &
 Move assignment operator that does not actually assign anything.
 
auto setReferringController (PropertyController &referringController) -> void
 Sets the referring controller, that is the property controller that contains this object.
 
auto referringController () const -> PropertyController *
 Gets the referring controller.
 

Detailed Description

A reference to an event belonging to a Xentara element.

Constructor & Destructor Documentation

◆ EventReference() [1/5]

xentara::workbench::process::EventReference::EventReference ( EventSearchOptions  options = {})
explicit

Constructor.

Parameters
optionsThe options to use when resolving the event

◆ EventReference() [2/5]

xentara::workbench::process::EventReference::EventReference ( const EventReference other)
default

Copy constructor.

◆ EventReference() [3/5]

xentara::workbench::process::EventReference::EventReference ( EventReference &&  other)
defaultnoexcept

Move constructor.

◆ EventReference() [4/5]

xentara::workbench::process::EventReference::EventReference ( const EventReference other,
EventSearchOptions  options 
)
noexcept

Copy constructor that copies the referred event but uses explicit options.

Parameters
otherThe reference to copy. Only the referred event is copied, the options are set to options specified in the options parameter.
optionsThe options to use when resolving the event

◆ EventReference() [5/5]

xentara::workbench::process::EventReference::EventReference ( EventReference &&  other,
EventSearchOptions  options 
)

Move constructor that moves the referred event but uses explicit options.

Parameters
otherThe reference to move. Only the referred event is moved, the options are set to options specified in the options parameter.
optionsThe options to use when resolving the event

Member Function Documentation

◆ event()

auto xentara::workbench::process::EventReference::event ( ) const -> utils::eh::expected<process::Event, ui::String>

Gets the event.

◆ operator bool()

internal xentara::workbench::process::EventReference::operator bool ( ) const
explicitnoexcept

Checks whether the reference points to anything.

◆ operator=() [1/2]

auto xentara::workbench::process::EventReference::operator= ( const EventReference rhs) -> EventReference &

Assignment operator.

Note
This operator only assigns the referred event. It does not modify the options specified in the constructor.
Parameters
rhsThe reference to assign. Only the referred event is copied, the options are not modified.
Returns
A reference to this object.

◆ operator=() [2/2]

auto xentara::workbench::process::EventReference::operator= ( EventReference &&  rhs) -> EventReference &
noexcept

Move-Assignment operator.

Note
This operator only assigns the referred event. It does not modify the options specified in the constructor.
Parameters
rhsThe reference to assign. Only the referred event is moved, the options are not modified.
Returns
A reference to this object.

◆ primaryKey()

auto xentara::workbench::process::EventReference::primaryKey ( ) const -> std::string

Gets the primary key of the event.

◆ save()

auto xentara::workbench::process::EventReference::save ( utils::json::encoder::Value jsonValue) const -> void

Writes the reference to a JSON value.

Parameters
jsonValueThe value

◆ saveTo() [1/2]

auto xentara::workbench::process::EventReference::saveTo ( utils::json::encoder::Array jsonArray) const -> void

Writes the reference to a JSON array.

Parameters
jsonArrayThe array

◆ saveTo() [2/2]

auto xentara::workbench::process::EventReference::saveTo ( utils::json::encoder::Object jsonObject,
std::string_view  name 
) const -> void

Adds the reference to a JSON object.

Parameters
jsonObjectThe object
nameThe member name