/* Math.Operation.cs 24 November 2009 - Adapted from old Dave codebase to generic DTS utility. $Log: Math.Operation.cs,v $ Revision 1.3 2007/03/28 15:58:55 Paul Hrissikopoulos Fixed erroneous error-checking in Domain accessor. Revision 1.2 2007/02/05 17:17:08 Paul Hrissikopoulos Finished installing generic channel math framework + basic calculus operations. Revision 1.1 2007/02/02 22:34:09 Paul Hrissikopoulos Added framework for DAVE channel math operators. Copyright © 2007 Diversified Technical Systems, Inc. All Rights Reserved */ using System; using System.Collections.Generic; using System.Text; using DTS.Common.Utilities; namespace DTS.Common.Utilities.Math { //////////////////////////////////////////////////////////////////////////////// /// /// Representation of a generic operation that maps a domain to a range. /// /// /// /// The input data type. /// /// /// /// The output data type. /// /// public abstract class Operation : Exceptional { //////////////////////////////////////////////////////////////////////////////// /// /// Get/set the domain of the differentiation. /// public DomainType Domain { get { try { if (null == domain) throw new NullReferenceException("value has not been set"); else return domain; } catch (System.Exception ex) { throw new Exception("encountered problem getting Domain property", ex); } } set { try { if (null == value) throw new ArgumentNullException("attempted to set value to null reference"); else domain = value; } catch (System.Exception ex) { throw new Exception("encountered problem setting Domain property", ex); } } } private DomainType domain; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// /// Get the result of the operation. /// public abstract RangeType Range { get; } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// /// Initialize an instance of the Math.Operation class. As a matter of style, /// a domain is required for object creation. /// /// /// /// The "DomainType" domain of this mathematical operation. /// /// public Operation(DomainType domain) { try { Domain = domain; } catch (System.Exception ex) { throw new Exception("encountered problem constructing Math.Operation", ex); } } //////////////////////////////////////////////////////////////////////////////// } //////////////////////////////////////////////////////////////////////////////// }