Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59fef328 authored by Andy Hung's avatar Andy Hung
Browse files

SingleStateQueue: Add last method to Mutator

Obtains last value written.

Test: see bug for CL topic and test
Bug: 80272001
Change-Id: Ia71752970ac2e66bb1c89cd9e06691fc88f64647
parent 40e34f6f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -99,6 +99,13 @@ private:
            return mShared->mAck - sequence >= 0;
        }

        // returns the last value written (or the contents of the shared buffer after initialization
        // if no value was written).
        T last() const
        {   // assume no sequence check required - we are the writer.
            return mShared->mValue;
        }

    private:
        int32_t     mSequence;
        Shared * const mShared;