1 // 2 // Copyright (c) 2010-2018 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 Antmicro.Renode.Peripherals; 9 10 namespace Antmicro.Renode.Core.Structure 11 { 12 /// <summary> 13 /// An object that allows registration of TPeripheral using TRegistrationPoint. 14 /// NOTE: This exists along IPeripheralContainer because some objects handle more than 15 /// one TRegistrationPoint for a given TPeripheral. 16 /// </summary> 17 public interface IPeripheralRegister<TPeripheral, TRegistrationPoint> : ICovariantPeripheralRegister<TPeripheral, TRegistrationPoint> 18 where TPeripheral : IPeripheral where TRegistrationPoint : IRegistrationPoint 19 { Register(TPeripheral peripheral, TRegistrationPoint registrationPoint)20 void Register(TPeripheral peripheral, TRegistrationPoint registrationPoint); Unregister(TPeripheral peripheral)21 void Unregister(TPeripheral peripheral); 22 } 23 24 // this interface is needed for `IRegisterController` which describes controller of 'any' register 25 // that is encoded as IPeripheralRegister<IPerhipheral, IRegistrationPoint> (that's why we need out) 26 public interface ICovariantPeripheralRegister<out TPeripheral, out TRegistrationPoint> : IEmulationElement 27 where TPeripheral : IPeripheral where TRegistrationPoint : IRegistrationPoint 28 { 29 } 30 } 31 32