template class hiro::gui::LinkedElement

Overview

An element which can be interpreted as a variable of a specific type. More…

#include <GuiTypes.h>

template <typename T, typename C>
class LinkedElement: public hiro::gui::TElement {
public:
    // methods

    virtual C* Set(const T new_value) = 0;
    virtual T Get() const = 0;
    C* SetLink(T* pointer);

protected:
    // methods

    virtual void NotifyChange() const;
};

Inherited Members

public:
    // methods

    bool TestCondition() const;
    uint32_t GetId() const;
    C* SetConditionFunc(std::function<bool(void)> condition_func);
    C* SetConditionBool(bool* var, hiro::BoolFunc func = hiro::BoolFunc::equals_true);
    C* Subscribe(std::function<void(const C*)> callback_func);

protected:
    // methods

    void SetConditionFuncImpl(std::function<bool(void)> condition_func);
    virtual void NotifyChange() const;

Detailed Documentation

An element which can be interpreted as a variable of a specific type.

Methods

virtual C* Set(const T new_value) = 0

Change the current value and notify subscribers if it differs from the previous value.

virtual T Get() const = 0

Get current value.

C* SetLink(T* pointer)

Set a variable updated according the element state.

  • Changes introduced to a link will not affect the element.

  • Only a single link can be active at a time.