struct EE::ObservableValue::State

struct State {
    // typedefs

    typedef std::function<void(const T&)> Callback;
    typedef SmallVector<Observer, 4> Observers;

    // structs

    struct Observer;

    // fields

    T value;
    Uint32 nextId { 0 };
    Observers observers;

    // construction

    State(T value);

    // methods

    void set(const T& newValue);
    void set(T&& newValue);
    void notify();
    Observers::iterator find(Uint32 id);
    Observers::const_iterator find(Uint32 id) const;
    bool contains(Uint32 id) const;
    void remove(Uint32 id);
};