00001 /* 00002 * Copyright (c) 2001-2006 00003 * DecisionSoft Limited. All rights reserved. 00004 * Copyright (c) 2004-2006 00005 * Progress Software Corporation. All rights reserved. 00006 * Copyright (c) 2004-2006 00007 * Oracle. All rights reserved. 00008 * 00009 * See the file LICENSE for redistribution information. 00010 * 00011 * $Id: ATDoubleOrDerived.hpp,v 1.9 2007/02/07 12:13:10 jpcs Exp $ 00012 */ 00013 00014 #ifndef _ATDOUBLEORDERIVED_HPP 00015 #define _ATDOUBLEORDERIVED_HPP 00016 00017 #include <xercesc/util/XercesDefs.hpp> 00018 #include <xqilla/framework/XQillaExport.hpp> 00019 #include <xqilla/items/Numeric.hpp> 00020 00021 class XQILLA_API ATDoubleOrDerived : public Numeric 00022 { 00023 public: 00024 typedef RefCountPointer<const ATDoubleOrDerived> Ptr; 00025 00026 /* Get the name of the primitive type (basic type) of this type 00027 * (ie "decimal" for xs:decimal) */ 00028 virtual const XMLCh* getPrimitiveTypeName() const = 0; 00029 00030 /* Get the namespace URI for this type */ 00031 virtual const XMLCh* getTypeURI() const = 0; 00032 00033 /* Get the name of this type (ie "integer" for xs:integer) */ 00034 virtual const XMLCh* getTypeName() const = 0; 00035 00036 /* returns the XMLCh* (canonical) representation of this type */ 00037 virtual const XMLCh* asString(const DynamicContext* context) const = 0; 00038 00039 /* Promote this to the given type, if possible */ 00040 virtual Numeric::Ptr promoteTypeIfApplicable(AnyAtomicType::AtomicObjectType typeIndex, 00041 const DynamicContext* context) const = 0; 00042 00044 virtual Numeric::Ptr add(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00045 00048 virtual Numeric::Ptr subtract(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00049 00051 virtual Numeric::Ptr multiply(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00052 00054 virtual Numeric::Ptr divide(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00055 00057 virtual Numeric::Ptr mod(const Numeric::Ptr &other, const DynamicContext* context) const = 0; 00058 00060 virtual Numeric::Ptr floor(const DynamicContext* context) const = 0; 00061 00063 virtual Numeric::Ptr ceiling(const DynamicContext* context) const = 0; 00064 00066 virtual Numeric::Ptr round(const DynamicContext* context) const = 0; 00067 00069 virtual Numeric::Ptr roundHalfToEven(const Numeric::Ptr &precision, const DynamicContext* context) const = 0; 00070 00072 virtual Numeric::Ptr invert(const DynamicContext* context) const = 0; 00073 00075 virtual Numeric::Ptr abs(const DynamicContext* context) const = 0; 00076 00077 /* Is this xs:double not a number */ 00078 virtual bool isNaN() const = 0; 00079 00080 /* Is this xs:double infinite? */ 00081 virtual bool isInfinite() const = 0; 00082 00084 virtual bool isZero() const = 0; 00085 00087 virtual bool isPositive() const = 0; 00088 00089 virtual AnyAtomicType::AtomicObjectType getPrimitiveTypeIndex() const = 0; 00090 00091 virtual const MAPM &asMAPM() const = 0; 00092 00093 virtual State getState() const = 0; 00094 }; 00095 00096 #endif // _ATDOUBLEORDERIVED_HPP