Arithmetic.FunctionAttribute

AttributeReferences
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public sealed class Arithmetic.FunctionAttribute : Attribute
Any function method inside an ArithmeticRepository must be decorated with this attribute to identify it as such. The method signature must follow: TResult Method(TA a, TB b)

Constructors

FunctionAttribute

#
Create a new binary function attribute. The method signature for this attribute must follow: TResult Method(TA a, TB b)
public FunctionAttribute()

FunctionAttribute

#
Create a new ternary function attribute. The method signature for this attribute must follow: TResult Method(TA a, TB b, TC c)
public FunctionAttribute()

FunctionAttribute

#
Create a new unary function attribute. The method signature for this attribute must follow: TResult Method(TA a)
public FunctionAttribute()

Properties

Arity

#
Gets the arity this attribute specifies.
public int Arity { get; }

Binary

#
Gets the binary function specified by this attribute. This property only has a meaningful value if the Arity equals 2.
public Arithmetic.Binary Binary { get; }

Ternary

#
Gets the ternary function specified by this attribute. This property only has a meaningful value if the Arity equals 3.
public Arithmetic.Ternary Ternary { get; }

Unary

#
Gets the unary function specified by this attribute. This property only has a meaningful value if the Arity equals 1.
public Arithmetic.Unary Unary { get; }