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

A reference to an attribute of a Xentara element. More...

#include <xentara/workbench/model/AttributeReference.hpp>

+ Inheritance diagram for xentara::workbench::model::AttributeReference:

Classes

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

Public Member Functions

internal operator bool () const noexcept
 Checks whether the reference points to anything.
 
auto attribute () const -> utils::eh::expected< model::Attribute, ui::String >
 Gets the attribute.
 
auto primaryKey () const -> std::string
 Gets the primary key of the attribute.
 
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 attribute of a Xentara element.

Member Function Documentation

◆ attribute()

auto xentara::workbench::model::AttributeReference::attribute ( ) const -> utils::eh::expected<model::Attribute, ui::String>

Gets the attribute.

◆ operator bool()

internal xentara::workbench::model::AttributeReference::operator bool ( ) const
explicitnoexcept

Checks whether the reference points to anything.

◆ primaryKey()

auto xentara::workbench::model::AttributeReference::primaryKey ( ) const -> std::string

Gets the primary key of the attribute.

◆ save()

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

Writes the reference to a JSON value.

Parameters
jsonValueThe value

◆ saveTo() [1/2]

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

Writes the reference to a JSON array.

Parameters
jsonArrayThe array

◆ saveTo() [2/2]

auto xentara::workbench::model::AttributeReference::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