CanSpecializeAttribute Class

When applied to a class or structure, indicates that the implementation of the type can be specialized for specific values of the type parameters.

Definition

Namespace: Extreme.Mathematics.Generic
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public class CanSpecializeAttribute : Attribute
Inheritance
Object  →  Attribute  →  CanSpecializeAttribute

Remarks

Use the CanSpecializeAttribute attribute on a generic type definition to indicate that the implementation can be overridden for specific values of the type parameters.

This attribute has two required parameters. The AssociationKey specifies a unique string value that identifies the specialization. The BaseType specifies the type that contains the generic implementation that can be specialized.

To create a specialization for a specific set of type parameters, inherit from the specialization base type and override any methods for which you have a specialized implementation. Also create a TypeAssociationAttribute that uses the key to associate the specializing type with the type of the type parameter, which is the owner type of the association.

Constructors

CanSpecializeAttribute Constructs a new CanSpecializeAttribute.

Properties

AssociationKey Gets the key that identifies the specialization in the collection of type associations of the type parameter type.
BaseType Gets the type of the base class that implements specialization.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)

Methods

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeReturns the hash code for this instance.
(Inherited from Attribute)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute)
MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also