using System;
namespace ICD.Common.Attributes
{
///
/// AbstractIcdAttribute is the base class for all ICD attributes.
/// It provides a global cache for looking up symbols via an attribute type.
///
public abstract class AbstractIcdAttribute : Attribute
{
private readonly int m_HashCode;
#region Constructors
///
/// Constructor.
///
protected AbstractIcdAttribute()
{
// Duplicate attributes (E.g. [A, A]) are considered to be the same instance by reflection.
// We get around this by using a GUID for the hash code.
m_HashCode = Guid.NewGuid().GetHashCode();
}
#endregion
#region Methods
///
/// Gets the hash code for the instance.
///
///
public override int GetHashCode()
{
return m_HashCode;
}
#endregion
}
}