using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace IPA.Config { /// /// A storage for a config structure. /// public interface IConfigStore { /// /// A synchronization object for the save thread to wait on for changes. /// It should be signaled whenever the internal state of the object is changed. /// The writer will never signal this handle. /// WaitHandle SyncObject { get; } /// /// A synchronization object for the load thread and accessors to maintain safe synchronization. /// Any readers should take a read lock with or /// , and any writers should take a /// write lock with . /// /// /// Read and write are read and write to *this object*, not to the file on disk. /// ReaderWriterLockSlim WriteSyncObject { get; } /// /// Writes the config structure stored by the current to the given /// . /// /// /// The calling code will have entered a read lock on when /// this is called. /// /// the provider to write to void WriteTo(ConfigProvider provider); /// /// Reads the config structure from the given into the current /// . /// /// /// The calling code will have entered a write lock on when /// this is called. /// /// the provider to read from void ReadFrom(ConfigProvider provider); } }