# ATFloatOrDerived.hpp

Go to the documentation of this file.

    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: ATFloatOrDerived.hpp,v 1.8 2006/11/01 16:37:14 jpcs Exp $
    00012  */
    00013
    00014 #ifndef _ATFLOATORDERIVED_HPP
    00015 #define _ATFLOATORDERIVED_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 ATFloatOrDerived : public Numeric
    00022 {
    00023 public:
    00024   typedef RefCountPointer<const ATFloatOrDerived> 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(const XMLCh* typeURI, const XMLCh* typeName, const DynamicContext* context) const = 0;
    00041
    00043   virtual Numeric::Ptr add(const Numeric::Ptr &other, const DynamicContext* context) const = 0;
    00044
    00047   virtual Numeric::Ptr subtract(const Numeric::Ptr &other, const DynamicContext* context) const = 0;
    00048
    00050   virtual Numeric::Ptr multiply(const Numeric::Ptr &other, const DynamicContext* context) const = 0;
    00051
    00053   virtual Numeric::Ptr divide(const Numeric::Ptr &other, const DynamicContext* context) const = 0;
    00054
    00056   virtual Numeric::Ptr mod(const Numeric::Ptr &other, const DynamicContext* context) const = 0;
    00057
    00059   virtual Numeric::Ptr floor(const DynamicContext* context) const = 0;
    00060
    00062   virtual Numeric::Ptr ceiling(const DynamicContext* context) const = 0;
    00063
    00065   virtual Numeric::Ptr round(const DynamicContext* context) const = 0;
    00066
    00068   virtual Numeric::Ptr roundHalfToEven(const Numeric::Ptr &precision, const DynamicContext* context) const = 0;
    00069
    00071   virtual Numeric::Ptr invert(const DynamicContext* context) const = 0;
    00072
    00073   /* Is this xs:double not a number */
    00074   virtual bool isNaN() const = 0;
    00075
    00076   /* Is this xs:double infinite? */
    00077   virtual bool isInfinite() const = 0;
    00078
    00080   virtual bool isZero() const = 0;
    00081
    00083   virtual bool isPositive() const = 0;
    00084
    00086   virtual bool isNegative() const = 0;
    00087
    00088   virtual AnyAtomicType::AtomicObjectType getPrimitiveTypeIndex() const = 0;
    00089
    00090   virtual const MAPM &asMAPM() const = 0;
    00091
    00092   virtual State getState() const = 0;
    00093 };
    00094
    00095 #endif //  _ATFLOATORDERIVED_HPP