1 // 2 // Copyright (c) 2010-2022 Antmicro 3 // Copyright (c) 2011-2015 Realtime Embedded 4 // 5 // This file is licensed under the MIT License. 6 // Full license text is available in 'licenses/MIT.txt'. 7 // 8 using System; 9 using System.Collections.Generic; 10 11 namespace Antmicro.Renode.Time 12 { 13 public interface IClockSource 14 { ExecuteInLock(Action action)15 void ExecuteInLock(Action action); AddClockEntry(ClockEntry entry)16 void AddClockEntry(ClockEntry entry); ExchangeClockEntryWith(Action handler, Func<ClockEntry, ClockEntry> visitor, Func<ClockEntry> factoryIfNonExistent = null)17 void ExchangeClockEntryWith(Action handler, Func<ClockEntry, ClockEntry> visitor, 18 Func<ClockEntry> factoryIfNonExistent = null); TryRemoveClockEntry(Action handler)19 bool TryRemoveClockEntry(Action handler); GetClockEntry(Action handler)20 ClockEntry GetClockEntry(Action handler); GetClockEntryInLockContext(Action handler, Action<ClockEntry> visitor)21 void GetClockEntryInLockContext(Action handler, Action<ClockEntry> visitor); GetAllClockEntries()22 IEnumerable<ClockEntry> GetAllClockEntries(); 23 TimeInterval CurrentValue { get; } EjectClockEntries()24 IEnumerable<ClockEntry> EjectClockEntries(); AddClockEntries(IEnumerable<ClockEntry> entries)25 void AddClockEntries(IEnumerable<ClockEntry> entries); 26 } 27 } 28 29