/// <inheritdoc />
 public string GetUnaryOperatorDescription(OverloadableCodeUnarySymmetricOperator unaryOperator)
 {
     return(unaryOperator switch
     {
         OverloadableCodeUnarySymmetricOperator.LogicalNegation => "Creates specification where the specification result will be negation of a result of aggregated specification.",
         _ => throw new NotSupportedException($"Operator {unaryOperator} is not supported."),
     });
Пример #2
0
 /// <inheritdoc />
 public bool IsUnaryOperatorSupported(OverloadableCodeUnarySymmetricOperator unaryOperator)
 {
     return(((int)unaryOperator & (int)SupportedOperators) != 0);
 }
Пример #3
0
 [Pure, MethodImpl(MethodImplOptions.AggressiveInlining), DebuggerStepThrough] public FXConstraintResult IsUnaryOperatorAllowed(OverloadableCodeUnarySymmetricOperator unaryOperator)
 {
     return(FXConstraintResult.Allowed);
 }
Пример #4
0
 public static UnaryOperatorFlexpression Create(OverloadableCodeUnarySymmetricOperator unaryOperator,
                                                IFlexpression argument)
 {
     return(new UnaryOperatorFlexpression(unaryOperator, argument));
 }
 /// <inheritdoc />
 public bool IsUnaryOperatorSupported(OverloadableCodeUnarySymmetricOperator unaryOperator)
 {
     return(unaryOperator.IsOneOf(SupportedOperators));
 }
Пример #6
0
        public static DefinableFxUnaryOperator ToDefinableFxOperator(this OverloadableCodeUnarySymmetricOperator source)
        {
            var res = (DefinableFxUnaryOperator)source;

            return(res);
        }
Пример #7
0
 public UnaryOperatorFlexpression(OverloadableCodeUnarySymmetricOperator unaryOperator, IFlexpression argument)
 {
     UnaryOperator = unaryOperator;
     Argument      = argument;
 }
 public static T GetOperatorResultOfHighestPrioritizedAlgebra <T>(this IDefineCodeOperatorSymmetricAlgebra <T> defaultAlgebra, OverloadableCodeUnarySymmetricOperator unaryOperator, T arg)
     where T : IDefineAlgebraicDomain <T, IDefineCodeOperatorSymmetricAlgebra <T> >
 {
     return(defaultAlgebra.GetHighestPrioritizedAlgebra(arg).EvaluateOperatorResult(unaryOperator, arg));
 }
 public static T GetOperatorResult <T>(this T arg, OverloadableCodeUnarySymmetricOperator unaryOperator)
     where T : IDefineAlgebraicDomain <T, IDefineCodeOperatorSymmetricAlgebra <T> >
 {
     return(arg.Algebra.EvaluateOperatorResult(unaryOperator, arg));
 }
Пример #10
0
 public static string GetSymbol(this OverloadableCodeUnarySymmetricOperator source)
 {
     return(source.ToCodeOperator().GetSymbol());
 }
Пример #11
0
 public static string ToCodeRepresentation(this OverloadableCodeUnarySymmetricOperator source, object singleArg = null, string spaceBetweenBinOperatorAndArgument = null)
 {
     return(source.ToCodeOperator().ToCodeRepresentation(singleArg, null, spaceBetweenBinOperatorAndArgument));
 }
Пример #12
0
 public static OverloadableCodeOperator ToCodeOperator(this OverloadableCodeUnarySymmetricOperator source)
 {
     return((OverloadableCodeOperator)source);
 }
Пример #13
0
 public static bool IsNotAnyOf(this OverloadableCodeUnarySymmetricOperator source, OverloadableCodeOperators flags)
 {
     return(((int)source & (int)flags) == 0);
 }
 public bool VisitUnaryOperator(OverloadableCodeUnarySymmetricOperator unaryOperator, bool argVisitationResult)
 {
     return(_specification.IsSatisfiedByUnaryOperator(unaryOperator, argVisitationResult));
 }
Пример #15
0
 [Pure] public virtual FXConstraintResult IsUnaryOperatorAllowed(OverloadableCodeUnarySymmetricOperator unaryOperator)
 {
     return(FXConstraintResult.Allowed);
 }
        [DebuggerStepThrough, DebuggerHidden, MethodImpl(MethodImplOptions.AggressiveInlining)] public static void ValidateUnaryOperatorAllowed(this IFlexpressionConstraint source, OverloadableCodeUnarySymmetricOperator unaryOperator)
        {
            var res = source.IsUnaryOperatorAllowed(unaryOperator);

            switch (res)
            {
            case FXConstraintResult.Allowed:
                return;

            default:
                throw new DomainConstraintBrokenException($"Unary operator '{unaryOperator.GetSymbol()}' ({unaryOperator}) is not allowed  by domain constraint ({source.GetType().Name}).");
            }
        }