// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; namespace osu.Game.Database { /// /// A wrapper to provide access to database backed classes in a thread-safe manner. /// /// The databased type. public interface ILive : IEquatable> where T : class // TODO: Add IHasGuidPrimaryKey once we don't need EF support any more. { Guid ID { get; } /// /// Perform a read operation on this live object. /// /// The action to perform. void PerformRead(Action perform); /// /// Perform a read operation on this live object. /// /// The action to perform. TReturn PerformRead(Func perform); /// /// Perform a write operation on this live object. /// /// The action to perform. void PerformWrite(Action perform); /// /// Whether this instance is tracking data which is managed by the database backing. /// bool IsManaged { get; } /// /// Resolve the value of this instance on the update thread. /// /// /// After resolving, the data should not be passed between threads. /// T Value { get; } } }