HomeReferenceSignal.h ⇀ VarSignal

VarSignal class

VarSignal extends the immutable Signal interface with functions that support imperative value input. In the dataflow graph, input signals are sources. As such, they don’t have any predecessors.

Synopsis

template
<
    typename D,
    typename S
>
class VarSignal : public Signal<D,S>
{
public:
    // Constructor
    VarSignal();
    VarSignal(const VarSignal&);    // Copy
    VarSignal(VarSignal&&);         // Move

    // Assignment
    VarSignal& operator=(const VarSignal&);     // Copy
    VarSignal& operator=(VarSignal&& other);    // Move

    // Set new signal value
    void Set(const S& newValue);
    void Set(S&& newValue);

    // Operator version of Set
    const VarSignal& operator<<=(const S& newValue);
    const VarSignal& operator<<=(S&& newValue);

    // Modify current signal value in-place
    void Modify(const F& func);
};

Constructor, operator= member function

Analogously defined to Signal.


Set member function

Syntax

void Set(const S& newValue) const;
void Set(S&& newValue) const;

Semantics

Set the the signal value of the linked variable signal node to newValue. If the old value equals the new value, the call has no effect.

Furthermore, if Set was called inside of a transaction function, it will return after the changed value has been set and change propagation is delayed until the transaction function returns. Otherwise, propagation starts immediately and Set blocks until it’s done.


operator<<= member function

Syntax

const VarSignal& operator<<=(const S& newValue);
const VarSignal& operator<<=(S&& newValue);

Semantics

Semantically equivalent to Set.


Modify member function

Syntax

template <typename F>
void Modify(const F& func);

Semantics

TODO