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

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

FunctionAttribute

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

FunctionAttribute

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

Properties

Arity

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

Binary

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

Ternary

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

Unary

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