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     public class Registered<TPeripheral, TRegistrationPoint> : IRegistered<TPeripheral, TRegistrationPoint>
13         where TPeripheral : IPeripheral where TRegistrationPoint : IRegistrationPoint
14     {
Registered(TPeripheral peripheral, TRegistrationPoint registrationPoint)15         public Registered(TPeripheral peripheral, TRegistrationPoint registrationPoint)
16         {
17             Peripheral = peripheral;
18             RegistrationPoint = registrationPoint;
19         }
20 
21         public TPeripheral Peripheral { get; private set; }
22         public TRegistrationPoint RegistrationPoint { get; private set; }
23     }
24 
25     public static class Registered
26     {
27         public static Registered<TPeripheral, TRegistrationPoint> Create<TPeripheral, TRegistrationPoint>
28             (TPeripheral peripheral, TRegistrationPoint registrationPoint)
29             where TPeripheral : IPeripheral  where TRegistrationPoint : IRegistrationPoint
30         {
31             return new Registered<TPeripheral, TRegistrationPoint>(peripheral, registrationPoint);
32         }
33     }
34 }
35