00001 /* 00002 * Copyright (c) 2001, 2008, 00003 * DecisionSoft Limited. All rights reserved. 00004 * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * 00007 * Licensed under the Apache License, Version 2.0 (the "License"); 00008 * you may not use this file except in compliance with the License. 00009 * You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, software 00014 * distributed under the License is distributed on an "AS IS" BASIS, 00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 * See the License for the specific language governing permissions and 00017 * limitations under the License. 00018 */ 00019 00020 #ifndef _ATDOUBLEORDERIVED_HPP 00021 #define _ATDOUBLEORDERIVED_HPP 00022 00023 #include <xercesc/util/XercesDefs.hpp> 00024 #include <xqilla/framework/XQillaExport.hpp> 00025 #include <xqilla/items/Numeric.hpp> 00026 00027 class XQILLA_API ATDoubleOrDerived : public Numeric 00028 { 00029 public: 00030 typedef RefCountPointer<const ATDoubleOrDerived> Ptr; 00031 00032 /* Get the name of the primitive type (basic type) of this type 00033 * (ie "decimal" for xs:decimal) */ 00034 virtual const XMLCh* getPrimitiveTypeName() const = 0; 00035 00036 /* Get the namespace URI for this type */ 00037 virtual const XMLCh* getTypeURI() const = 0; 00038 00039 /* Get the name of this type (ie "integer" for xs:integer) */ 00040 virtual const XMLCh* getTypeName() const = 0; 00041 00042 /* returns the XMLCh* (canonical) representation of this type */ 00043 virtual const XMLCh* asString(const DynamicContext* context) const = 0; 00044 00045 /* Promote this to the given type, if possible */ 00046 virtual Numeric::Ptr promoteTypeIfApplicable(AnyAtomicType::AtomicObjectType typeIndex, 00047 const DynamicContext* context) const = 0; 00048 00050 virtual Numeric::Ptr add(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00051 00054 virtual Numeric::Ptr subtract(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00055 00057 virtual Numeric::Ptr multiply(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00058 00060 virtual Numeric::Ptr divide(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00061 00063 virtual Numeric::Ptr mod(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00064 00066 virtual Numeric::Ptr floor(const DynamicContext* context) const = 0; 00067 00069 virtual Numeric::Ptr ceiling(const DynamicContext* context) const = 0; 00070 00072 virtual Numeric::Ptr round(const DynamicContext* context) const = 0; 00073 00075 virtual Numeric::Ptr roundHalfToEven(const Numeric::Ptr &precision, const DynamicContext* context) const = 0; 00076 00078 virtual Numeric::Ptr invert(const DynamicContext* context) const = 0; 00079 00081 virtual Numeric::Ptr abs(const DynamicContext* context) const = 0; 00082 00084 virtual Numeric::Ptr sqrt(const DynamicContext* context) const = 0; 00085 00087 virtual Numeric::Ptr sin(const DynamicContext* context) const = 0; 00088 00090 virtual Numeric::Ptr cos(const DynamicContext* context) const = 0; 00091 00093 virtual Numeric::Ptr tan(const DynamicContext* context) const = 0; 00094 00096 virtual Numeric::Ptr asin(const DynamicContext* context) const = 0; 00097 00099 virtual Numeric::Ptr acos(const DynamicContext* context) const = 0; 00100 00102 virtual Numeric::Ptr atan(const DynamicContext* context) const = 0; 00103 00105 virtual Numeric::Ptr log(const DynamicContext* context) const = 0; 00106 00108 virtual Numeric::Ptr exp(const DynamicContext* context) const = 0; 00109 00110 /* Is this xs:double not a number */ 00111 virtual bool isNaN() const = 0; 00112 00113 /* Is this xs:double infinite? */ 00114 virtual bool isInfinite() const = 0; 00115 00117 virtual bool isZero() const = 0; 00118 00120 virtual bool isPositive() const = 0; 00121 00122 virtual AnyAtomicType::AtomicObjectType getPrimitiveTypeIndex() const = 0; 00123 00124 virtual const MAPM &asMAPM() const = 0; 00125 00126 virtual State getState() const = 0; 00127 }; 00128 00129 #endif // _ATDOUBLEORDERIVED_HPP