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 System; 9 using Antmicro.Renode.Core.Structure; 10 11 namespace Antmicro.Renode.Peripherals.Network 12 { 13 public class PHYRegistrationPoint : IRegistrationPoint 14 { PHYRegistrationPoint(uint id)15 public PHYRegistrationPoint(uint id) 16 { 17 Id = id; 18 } 19 20 public string PrettyString { 21 get { 22 return ToString(); 23 } 24 } 25 ToString()26 public override string ToString() 27 { 28 return string.Format("Address: {0}", Id); 29 } 30 31 public uint Id {get; private set;} 32 Equals(object obj)33 public override bool Equals(object obj) 34 { 35 var other = obj as PHYRegistrationPoint; 36 if(other == null) 37 return false; 38 if(ReferenceEquals(this, obj)) 39 return true; 40 return Id == other.Id; 41 } 42 43 GetHashCode()44 public override int GetHashCode() 45 { 46 unchecked 47 { 48 return Id.GetHashCode(); 49 } 50 } 51 52 } 53 } 54 55