// // Copyright (c) 2010-2018 Antmicro // // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // using System; using System.Collections.Generic; using System.Linq; namespace Antmicro.Renode.Utilities.Collections { public sealed class LazyList { public LazyList() { funcs = new List>(); } public void Add(Func func) { funcs.Add(func); } public List ToList() { return funcs.Select(x => x()).ToList(); } private readonly List> funcs; } }